修改返回数据方式

上级 8455b3fb
...@@ -97,6 +97,8 @@ public class UserAccountVO implements Serializable { ...@@ -97,6 +97,8 @@ public class UserAccountVO implements Serializable {
private Integer backUserId; private Integer backUserId;
@ApiModelProperty(value = "密码") @ApiModelProperty(value = "密码")
private String password; private String password;
@ApiModelProperty(value = "用户状态") @ApiModelProperty(value = "用户状态")
private String userState; private UserStateVO userStateVO;
} }
package com.mmc.iuav.user.model.vo;
import java.io.Serializable;
/**
* (UserState)实体类
*
* @author makejava
* @since 2024-03-20 10:09:59
*/
public class UserStateVO implements Serializable {
private static final long serialVersionUID = -32633125960150583L;
private Integer id;
/**
* 用户状态
*/
private String state;
/**
* 状态图标
*/
private String icon;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
}
\ No newline at end of file
...@@ -10,6 +10,7 @@ import com.mmc.iuav.user.model.qo.UserAccountQO; ...@@ -10,6 +10,7 @@ import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO; import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO; import com.mmc.iuav.user.model.qo.UserRcdQO;
import com.mmc.iuav.user.model.vo.UserAccountMessageVo; import com.mmc.iuav.user.model.vo.UserAccountMessageVo;
import com.mmc.iuav.user.model.vo.UserStateVO;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -260,4 +261,11 @@ public interface UserServiceDao { ...@@ -260,4 +261,11 @@ public interface UserServiceDao {
UserAccountDO getUserAccountInfoByPhoneNum(String phoneNum); UserAccountDO getUserAccountInfoByPhoneNum(String phoneNum);
List<UserStateDO> getStateList(); List<UserStateDO> getStateList();
/**
* 获取用户当前状态
* @param stateId 状态id
* @return {@link UserStateVO}
*/
UserStateVO getUserState(Integer stateId);
} }
...@@ -92,7 +92,7 @@ public class UserAccountDO implements Serializable { ...@@ -92,7 +92,7 @@ public class UserAccountDO implements Serializable {
//web端登录密码 //web端登录密码
private String password; private String password;
@ApiModelProperty(value = "用户状态") @ApiModelProperty(value = "用户状态")
private String userState; private Integer userStateId;
public UserAccountDO(UserAccountVO userAccountVO) { public UserAccountDO(UserAccountVO userAccountVO) {
this.id = userAccountVO.getId(); this.id = userAccountVO.getId();
this.phoneNum = userAccountVO.getPhoneNum(); this.phoneNum = userAccountVO.getPhoneNum();
...@@ -141,7 +141,6 @@ public class UserAccountDO implements Serializable { ...@@ -141,7 +141,6 @@ public class UserAccountDO implements Serializable {
.coverPicture(this.coverPicture) .coverPicture(this.coverPicture)
.districtChildId(this.districtChildId) .districtChildId(this.districtChildId)
.password(this.password) .password(this.password)
.userState(this.userState)
.build(); .build();
} }
......
...@@ -165,6 +165,10 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -165,6 +165,10 @@ public class UserAccountServiceImpl implements UserAccountService {
if(backUserId!=null) { if(backUserId!=null) {
userAccountVO.setBackUserId(backUserId); userAccountVO.setBackUserId(backUserId);
} }
Integer userStateId = userAccountDO.getUserStateId();
if(userStateId != null){
userAccountVO.setUserStateVO(userServiceDao.getUserState(userStateId));
}
return userAccountVO; return userAccountVO;
} }
......
...@@ -209,11 +209,10 @@ ...@@ -209,11 +209,10 @@
ua.brief_introduction, ua.brief_introduction,
ua.cover_picture, ua.cover_picture,
ua.district_child_id, ua.district_child_id,
us.state as user_state ua.user_state_id
FROM user_account ua FROM user_account ua
LEFT JOIN pilot_certification pc ON pc.user_account_id = ua.id LEFT JOIN pilot_certification pc ON pc.user_account_id = ua.id
LEFT JOIN user_points up ON up.user_account_id = ua.id LEFT JOIN user_points up ON up.user_account_id = ua.id
left join user_state us on us.id = ua.user_state_id
WHERE ua.id = #{id} WHERE ua.id = #{id}
</select> </select>
...@@ -776,5 +775,8 @@ ...@@ -776,5 +775,8 @@
<select id="getStateList" resultType="com.mmc.iuav.user.entity.UserStateDO"> <select id="getStateList" resultType="com.mmc.iuav.user.entity.UserStateDO">
select id,state,icon from user_state select id,state,icon from user_state
</select> </select>
<select id="getUserState" resultType="com.mmc.iuav.user.model.vo.UserStateVO">
select id,state,icon from user_state where id = #{stateId}
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论