diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MyBatisPlusConfig.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MyBatisPlusConfig.java
index 5e897e3..f72c717 100644
--- a/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MyBatisPlusConfig.java
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MyBatisPlusConfig.java
@@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableTransactionManagement
-@MapperScan("com.hydrogen.examSystem.dao")
+@MapperScan("com.hydrogen.applet.dao")
public class MyBatisPlusConfig {
/**
* 分页插件
diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MybatisGenerator.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MybatisGenerator.java
index ba82295..be571d8 100644
--- a/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MybatisGenerator.java
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/config/MybatisGenerator.java
@@ -23,10 +23,10 @@ import java.util.Scanner;
*/
public class MybatisGenerator {
- private static final String MYSQL_URL ="jdbc:mysql://120.46.194.248:13306/jhqm_exam?useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true";
+ private static final String MYSQL_URL ="jdbc:mysql://120.46.194.248:13306/hydrogen?useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true";
private static final String MYSQL_DRIVE ="com.mysql.cj.jdbc.Driver";
- private static final String MYSQL_U ="exam_user";
- private static final String MYSQL_P ="7Js$A2LcTKy=";
+ private static final String MYSQL_U ="hydrogen_user";
+ private static final String MYSQL_P ="sFgo)_%h4CD5";
/**
@@ -56,8 +56,8 @@ public class MybatisGenerator {
// 全局配置
GlobalConfig gc = new GlobalConfig();
final String projectPath = System.getProperty("user.dir");
- gc.setOutputDir(projectPath + "/src/main/java");
- gc.setAuthor("linyx");
+ gc.setOutputDir("D:/soft/src/main/java");
+ gc.setAuthor("fjc");
gc.setOpen(false);
gc.setServiceName("%sService");// service 命名方式
gc.setServiceImplName("%sServiceImpl");// service impl 命名方式
@@ -85,7 +85,7 @@ public class MybatisGenerator {
// 包配置
PackageConfig pc = new PackageConfig();
//pc.setModuleName(scanner("模块名"));
- pc.setParent("com.hydrogen.examSystem");
+ pc.setParent("com.hydrogen.mbg");
pc.setEntity("entity");
pc.setService("service");
pc.setServiceImpl("service.impl");
@@ -109,7 +109,7 @@ public class MybatisGenerator {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名
- return projectPath + "/src/main/resources/mapping/"
+ return "D:/soft/src/main/resources/mapping/"
+ tableInfo.getEntityName() + "Dao" + StringPool.DOT_XML;
}
});
@@ -133,8 +133,8 @@ public class MybatisGenerator {
strategy.setInclude(scanner("表名"));
strategy.setControllerMappingHyphenStyle(true);
strategy.setEntityLombokModel(true);
- strategy.setTablePrefix("t_exam_system_");
- strategy.setFieldPrefix("f_");
+// strategy.setTablePrefix("t_exam_system_");
+// strategy.setFieldPrefix("f_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/config/WeixinConfig.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/config/WeixinConfig.java
new file mode 100644
index 0000000..a877577
--- /dev/null
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/config/WeixinConfig.java
@@ -0,0 +1,39 @@
+package com.hydrogen.applet.config;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
+
+/**
+ * @author fjc
+ * @company jh——qm
+ * @create 2024-07-23 15:57
+ */
+@Configuration
+public class WeixinConfig {
+ @Value("${wx.miniapp.app-id}")
+ private String appId;
+ @Value("${wx.miniapp.app-secret}")
+ private String appSecret;
+ @Value("${wx.miniapp.mch-id}")
+ private String mchId;
+ @Value("${wx.miniapp.msgDataFormat}")
+ private String msgDataFormat;
+ @Bean
+ public WxMaService wxMaService() {
+ WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
+ config.setAppid(appId);
+ config.setSecret(appSecret);
+ config.setMsgDataFormat(msgDataFormat);
+// config.setToken(environment.getProperty("wx.miniapp.token"));
+// config.setAesKey(environment.getProperty("wx.miniapp.aesKey"));
+
+ WxMaService service = new WxMaServiceImpl();
+ service.setWxMaConfig(config);
+ return service;
+ }
+}
diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/controller/LoginController.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/controller/LoginController.java
new file mode 100644
index 0000000..e85a092
--- /dev/null
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/controller/LoginController.java
@@ -0,0 +1,28 @@
+package com.hydrogen.applet.controller;
+
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import com.hydrogen.mbg.dto.applet.LoginDTO;
+
+import com.hydrogen.mbg.vo.DrhtResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+@RestController
+@RequestMapping("/applet/login")
+@Api(tags = "小程序登录注册")
+public class LoginController {
+ @PostMapping("/login")
+ @ApiOperation(value = "小程序登录注册")
+ public DrhtResult login(@RequestBody @Validated LoginDTO dto) {
+
+ return null;
+ }
+
+}
diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/dao/MemberDao.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/dao/MemberDao.java
new file mode 100644
index 0000000..9757b16
--- /dev/null
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/dao/MemberDao.java
@@ -0,0 +1,16 @@
+package com.hydrogen.applet.dao;
+
+import com.hydrogen.mbg.entity.Member;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ *
+ * 会员表 Mapper 接口
+ *
+ *
+ * @author fjc
+ * @since 2024-07-23
+ */
+public interface MemberDao extends BaseMapper {
+
+}
diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/service/Impl/LoginServiceImpl.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/service/Impl/LoginServiceImpl.java
new file mode 100644
index 0000000..a33f38f
--- /dev/null
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/service/Impl/LoginServiceImpl.java
@@ -0,0 +1,26 @@
+package com.hydrogen.applet.service.Impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hydrogen.applet.dao.MemberDao;
+import com.hydrogen.applet.service.LoginService;
+import com.hydrogen.mbg.entity.Member;
+import com.hydrogen.mbg.entity.Paper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author fjc
+ * @company jh——qm
+ * @create 2024-07-23 16:28
+ */
+@Service
+public class LoginServiceImpl extends ServiceImpl implements LoginService {
+
+ private final WxMaService wxService;
+
+ @Autowired
+ public LoginServiceImpl(WxMaService wxService) {
+ this.wxService = wxService;
+ }
+}
diff --git a/hydrogen-applet/src/main/java/com/hydrogen/applet/service/LoginService.java b/hydrogen-applet/src/main/java/com/hydrogen/applet/service/LoginService.java
new file mode 100644
index 0000000..931f783
--- /dev/null
+++ b/hydrogen-applet/src/main/java/com/hydrogen/applet/service/LoginService.java
@@ -0,0 +1,16 @@
+package com.hydrogen.applet.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hydrogen.mbg.entity.Member;
+import com.hydrogen.mbg.entity.Paper;
+
+/**
+ * @author fjc
+ * @company jh——qm
+ * @create 2024-07-23 16:27
+ */
+public interface LoginService extends IService {
+
+
+}
diff --git a/hydrogen-applet/src/main/resources/application.yml b/hydrogen-applet/src/main/resources/application.yml
index 4d1372a..c68cbed 100644
--- a/hydrogen-applet/src/main/resources/application.yml
+++ b/hydrogen-applet/src/main/resources/application.yml
@@ -68,4 +68,20 @@ mybatis-plus:
jwt:
secret: hydrogenUserSecret
expiration: 604800
- tokenHead: hydrogenBearer
\ No newline at end of file
+ tokenHead: hydrogenBearer
+wx:
+ miniapp:
+ app-id: wx660c9f833e43ce25 #微信小程序的appid
+ app-secret: 6160ae34e8617af8a8b7adcd468d898a #微信小程序的Secret # 小程序密钥
+ # 商户号
+ mch-id: 1668300858
+ # 证书序列号
+ mch-serial-no: 66381F5B62A3E8D1AF847A17386AEFD99DA7B8C7
+ # apiv3密钥
+ api-key:
+ # 回调接口地址
+ # notify-url: https://xxxx/a/biz/wxpay/payNotify
+ # 证书地址
+ key-path:
+ #消息格式
+ msgDataFormat: JSON
\ No newline at end of file
diff --git a/hydrogen-applet/src/main/resources/mapper/MemberDao.xml b/hydrogen-applet/src/main/resources/mapper/MemberDao.xml
new file mode 100644
index 0000000..2a7f5fd
--- /dev/null
+++ b/hydrogen-applet/src/main/resources/mapper/MemberDao.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ member_id, user_name, nick_name, user_photo, user_sex, birthday, region_id, region_name, phone, login_pws, bank_account, pay_pws, total_recharge, balance, qingbao, toatl_profit, profit_balance, total_integral, integral_balance, Column_35, Column_36, Column_37, Column_38, create_time, update_time, enabled, terminal, last_login, salt, reg_canal, parent_uid, wx_uid, wx_opid, xcx_opid, tenant_id, site_id, agent_id, shop_id
+
+
+
diff --git a/hydrogen-mbg/pom.xml b/hydrogen-mbg/pom.xml
index d4dd635..c4da3ef 100644
--- a/hydrogen-mbg/pom.xml
+++ b/hydrogen-mbg/pom.xml
@@ -16,5 +16,20 @@
8
UTF-8
-
+
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+
+
+
+ com.baomidou
+ mybatis-plus-generator
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+
+
\ No newline at end of file
diff --git a/hydrogen-mbg/src/main/java/com/hydrogen/mbg/dto/applet/LoginDTO.java b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/dto/applet/LoginDTO.java
new file mode 100644
index 0000000..967552d
--- /dev/null
+++ b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/dto/applet/LoginDTO.java
@@ -0,0 +1,19 @@
+package com.hydrogen.mbg.dto.applet;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel(value = "小程序登录DTO")
+public class LoginDTO {
+ @ApiModelProperty(value = "登录凭证(code)",required = true)
+ @NotNull(message = "登录凭证(code)不能为空")
+ private String code;
+
+ @ApiModelProperty(value = "携带场景请求参数,格式为(a=1#b=2)")
+ private String scene;
+
+}
\ No newline at end of file
diff --git a/hydrogen-mbg/src/main/java/com/hydrogen/mbg/entity/Member.java b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/entity/Member.java
new file mode 100644
index 0000000..73f77de
--- /dev/null
+++ b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/entity/Member.java
@@ -0,0 +1,190 @@
+package com.hydrogen.mbg.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ *
+ * 会员表
+ *
+ *
+ * @author fjc
+ * @since 2024-07-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("member")
+@ApiModel(value="Member对象", description="会员表")
+public class Member extends Model {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "会员编号")
+ @TableId(value = "member_id", type = IdType.AUTO)
+ private Integer memberId;
+
+ @ApiModelProperty(value = "真实姓名")
+ @TableField("user_name")
+ private String userName;
+
+ @ApiModelProperty(value = "会员昵称")
+ @TableField("nick_name")
+ private String nickName;
+
+ @ApiModelProperty(value = "会员头像")
+ @TableField("user_photo")
+ private String userPhoto;
+
+ @ApiModelProperty(value = "会员性别:0保密1男2女")
+ @TableField("user_sex")
+ private Integer userSex;
+
+ @ApiModelProperty(value = "出生日期")
+ @TableField("birthday")
+ private LocalDate birthday;
+
+ @ApiModelProperty(value = "城市编码")
+ @TableField("region_id")
+ private Integer regionId;
+
+ @ApiModelProperty(value = "城市名称:如河北省 石家庄 裕华区 ")
+ @TableField("region_name")
+ private String regionName;
+
+ @ApiModelProperty(value = "手机号码")
+ @TableField("phone")
+ private String phone;
+
+ @ApiModelProperty(value = "登录密码")
+ @TableField("login_pws")
+ private String loginPws;
+
+ @ApiModelProperty(value = "银行账户{开户行,名称,账号}")
+ @TableField("bank_account")
+ private String bankAccount;
+
+ @ApiModelProperty(value = "支付密码")
+ @TableField("pay_pws")
+ private String payPws;
+
+ @ApiModelProperty(value = "累计充值")
+ @TableField("total_recharge")
+ private BigDecimal totalRecharge;
+
+ @ApiModelProperty(value = "钱包余额")
+ @TableField("balance")
+ private BigDecimal balance;
+
+ @ApiModelProperty(value = "氢宝余额")
+ @TableField("qingbao")
+ private BigDecimal qingbao;
+
+ @ApiModelProperty(value = "累计收益")
+ @TableField("toatl_profit")
+ private BigDecimal toatlProfit;
+
+ @ApiModelProperty(value = "收益余额")
+ @TableField("profit_balance")
+ private BigDecimal profitBalance;
+
+ @ApiModelProperty(value = "总积分数")
+ @TableField("total_integral")
+ private Integer totalIntegral;
+
+ @ApiModelProperty(value = "积分余额")
+ @TableField("integral_balance")
+ private Integer integralBalance;
+
+ @ApiModelProperty(value = "吸氢时长")
+ @TableField("Column_35")
+ private String column35;
+
+ @ApiModelProperty(value = "当前排名")
+ @TableField("Column_36")
+ private String column36;
+
+ @ApiModelProperty(value = "健康标签")
+ @TableField("Column_37")
+ private String column37;
+
+ @TableField("Column_38")
+ private String column38;
+
+ @ApiModelProperty(value = "注册时间")
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ @ApiModelProperty(value = "修改时间")
+ @TableField("update_time")
+ private LocalDateTime updateTime;
+
+ @ApiModelProperty(value = "账号状态:0禁用,1开通")
+ @TableField("enabled")
+ private Boolean enabled;
+
+ @ApiModelProperty(value = "注册终端:1安卓,2苹果,3H5,4小程序")
+ @TableField("terminal")
+ private Integer terminal;
+
+ @ApiModelProperty(value = "登录时间")
+ @TableField("last_login")
+ private LocalDateTime lastLogin;
+
+ @ApiModelProperty(value = "散列值号")
+ @TableField("salt")
+ private String salt;
+
+ @ApiModelProperty(value = "来源渠道:1自由注册,2终端店面,3店内员工,4会员分享,5其他来源")
+ @TableField("reg_canal")
+ private Integer regCanal;
+
+ @ApiModelProperty(value = "推广人员编号")
+ @TableField("parent_uid")
+ private Integer parentUid;
+
+ @ApiModelProperty(value = "微信uid")
+ @TableField("wx_uid")
+ private String wxUid;
+
+ @ApiModelProperty(value = "微信openid")
+ @TableField("wx_opid")
+ private String wxOpid;
+
+ @ApiModelProperty(value = "小程序openid")
+ @TableField("xcx_opid")
+ private String xcxOpid;
+
+ @ApiModelProperty(value = "厂商编号")
+ @TableField("tenant_id")
+ private Integer tenantId;
+
+ @ApiModelProperty(value = "站点编号")
+ @TableField("site_id")
+ private Integer siteId;
+
+ @ApiModelProperty(value = "渠道编号")
+ @TableField("agent_id")
+ private Integer agentId;
+
+ @ApiModelProperty(value = "商户编号")
+ @TableField("shop_id")
+ private Integer shopId;
+
+
+ @Override
+ protected Serializable pkVal() {
+ return this.memberId;
+ }
+
+}
diff --git a/hydrogen-mbg/src/main/java/com/hydrogen/mbg/entity/Paper.java b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/entity/Paper.java
new file mode 100644
index 0000000..36c11b5
--- /dev/null
+++ b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/entity/Paper.java
@@ -0,0 +1,78 @@
+package com.hydrogen.mbg.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *
+ * 考试表
+ *
+ *
+ * @author zp
+ * @since 2024-06-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("t_exam_system_paper")
+@ApiModel(value="Paper对象", description="考试表")
+public class Paper extends Model {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "f_id")
+ @TableId(value = "f_id", type = IdType.ASSIGN_ID)
+ private Long id;
+
+ @ApiModelProperty(value = "考试名称")
+ @TableField("f_paper_name")
+ private String paperName;
+
+ @ApiModelProperty(value = "考试开始时间")
+ @TableField("f_start_time")
+ private LocalDateTime startTime;
+
+ @ApiModelProperty(value = "考试结束时间")
+ @TableField("f_end_time")
+ private LocalDateTime endTime;
+
+ @ApiModelProperty(value = "考试模式 1固定试题 2随机试题")
+ @TableField("f_exam_type")
+ private Integer examType;
+
+ @ApiModelProperty(value = "考试规则")
+ @TableField("f_exam_rule")
+ private String examRule;
+
+ @ApiModelProperty(value = "科目库id")
+ @TableField("f_subject_id")
+ private Long subjectId;
+
+ @ApiModelProperty(value = "发布状态 1未发布 2已发布")
+ @TableField("f_status")
+ private Integer status;
+
+ @ApiModelProperty(value = "组织id")
+ @TableField("f_org_id")
+ private Long orgId;
+
+ @ApiModelProperty(value = "插入时间")
+ @TableField("f_create_time")
+ private LocalDateTime createTime;
+
+
+ @Override
+ protected Serializable pkVal() {
+ return this.id;
+ }
+
+}
diff --git a/hydrogen-mbg/src/main/java/com/hydrogen/mbg/vo/applet/LoginVO.java b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/vo/applet/LoginVO.java
new file mode 100644
index 0000000..7622e76
--- /dev/null
+++ b/hydrogen-mbg/src/main/java/com/hydrogen/mbg/vo/applet/LoginVO.java
@@ -0,0 +1,18 @@
+package com.hydrogen.mbg.vo.applet;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel(value = "小程序登录返回VO")
+public class LoginVO {
+ @ApiModelProperty(value = "登录凭证(code)")
+ private String code;
+
+ @ApiModelProperty(value = "携带场景请求参数,格式为(a=1#b=2)")
+ private String scene;
+
+}
\ No newline at end of file