diff --git a/src/main/java/com/northtecom/visatrack/api/data/entity/WeChatCallState.java b/src/main/java/com/northtecom/visatrack/api/data/entity/WeChatCallState.java index 9ea970c..1b46cd9 100644 --- a/src/main/java/com/northtecom/visatrack/api/data/entity/WeChatCallState.java +++ b/src/main/java/com/northtecom/visatrack/api/data/entity/WeChatCallState.java @@ -6,14 +6,12 @@ import lombok.Data; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; -import java.time.LocalDateTime; + /** - * Created with IntelliJ IDEA. + * WeChat API Call State to get user information and access token * - * @Author: XieYang - * @Date: 2022/10/10/19:21 - * @Description: + * @author YuCheng */ @Entity @Data @@ -21,30 +19,24 @@ import java.time.LocalDateTime; @org.hibernate.annotations.Table(appliesTo = "wechat_call_state", comment = "WeChat Call State") public class WeChatCallState extends BaseEntity { - /** - * User id - */ @Column(name = "wechat_state", columnDefinition = "varchar(255) COMMENT 'wechat state'") private String weChatState; - /** - * User olc password - */ + @Column(name = "wechat_code", columnDefinition = "varchar(255) COMMENT 'wechat code") + private String weChatCode; + + @Column(name = "wechat_access_token", columnDefinition = "varchar(255) COMMENT 'wechat access token") + private String weChatAccessToken; + @Column(name = "wechat_openid", columnDefinition = "varchar(255) COMMENT 'wechat openid'") private String weChatOpenId; - /** - * User new password - */ @Column(name = "wechat_unionid", columnDefinition = "varchar(255) COMMENT 'wechat unionid'") private String weChatUnionId; - /** - * User change password time - */ - @Column(name = "date_call_state", columnDefinition = "DATETIME COMMENT 'User change password time'") - private LocalDateTime dateCallState; - - + @Column(name = "nickname", columnDefinition = "varchar(255) COMMENT 'wechat nickname'") + private String nickName; + @Column(name = "head_img_url", columnDefinition = "varchar(255) COMMENT 'wechat head image url'") + private String headImgURL; } diff --git a/src/main/java/com/northtecom/visatrack/api/service/impl/WeChatService.java b/src/main/java/com/northtecom/visatrack/api/service/impl/WeChatService.java index dacc0ab..4d9502f 100644 --- a/src/main/java/com/northtecom/visatrack/api/service/impl/WeChatService.java +++ b/src/main/java/com/northtecom/visatrack/api/service/impl/WeChatService.java @@ -73,6 +73,8 @@ public class WeChatService { log.debug("WeChat NickName - [{}]", weChatUser.getNickname()); WeChatCallState weChatCallState = new WeChatCallState(); weChatCallState.setWeChatState(weChatState); + weChatCallState.setWeChatCode(weChatCode); + weChatCallState.setWeChatAccessToken(accessToken); weChatCallState.setWeChatOpenId(weChatUser.getOpenId()); weChatCallState.setWeChatUnionId(weChatUser.getUnionId()); weChatCallStateRepository.save(weChatCallState);