Browse Source

测试上传头像

master
zy_Java 5 years ago
parent
commit
7ecdc99fc1
  1. 4
      cloudutil/src/main/resources/application-util-test.yml
  2. 32
      tall/src/main/java/com/ccsens/tall/bean/dto/MemberDto.java
  3. 46
      tall/src/main/java/com/ccsens/tall/bean/dto/UserDto.java
  4. 1
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  5. 2
      tall/src/main/java/com/ccsens/tall/persist/dao/SysRingMsgDao.java
  6. 8
      tall/src/main/java/com/ccsens/tall/service/IProMemberService.java
  7. 2
      tall/src/main/java/com/ccsens/tall/service/IRingService.java
  8. 32
      tall/src/main/java/com/ccsens/tall/service/IUserInfoService.java
  9. 24
      tall/src/main/java/com/ccsens/tall/service/IUserService.java
  10. 132
      tall/src/main/java/com/ccsens/tall/service/ProMemberService.java
  11. 75
      tall/src/main/java/com/ccsens/tall/service/RingService.java
  12. 150
      tall/src/main/java/com/ccsens/tall/service/UserInfoService.java
  13. 127
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  14. 12
      tall/src/main/java/com/ccsens/tall/util/TallConstant.java
  15. 2
      tall/src/main/java/com/ccsens/tall/web/ExcelController.java
  16. 38
      tall/src/main/java/com/ccsens/tall/web/MemberController.java
  17. 6
      tall/src/main/java/com/ccsens/tall/web/RingController.java
  18. 12
      tall/src/main/java/com/ccsens/tall/web/UserController.java
  19. 70
      tall/src/main/java/com/ccsens/tall/web/UserInfoController.java
  20. 1
      tall/src/main/resources/application-dev.yml
  21. 10
      tall/src/main/resources/application-test.yml
  22. 4
      tall/src/main/resources/application.yml
  23. 8
      tall/src/main/resources/druid-test.yml
  24. 2
      tall/src/main/resources/mapper_dao/SysOperationDao.xml
  25. 56
      tall/src/main/resources/mapper_dao/SysRingMsgDao.xml
  26. 6
      util/src/main/java/com/ccsens/util/CodeEnum.java
  27. 3
      util/src/main/java/com/ccsens/util/UploadFileUtil_Servlet3.java
  28. 5
      util/src/main/java/com/ccsens/util/WebConstant.java

4
cloudutil/src/main/resources/application-util-test.yml

@ -20,8 +20,8 @@ eureka:
service-url: service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 # 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ # defaultZone: http://admin:admin@192.168.0.99:7010/eureka/
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/ defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/
instance: instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true prefer-ip-address: true

32
tall/src/main/java/com/ccsens/tall/bean/dto/MemberDto.java

@ -0,0 +1,32 @@
package com.ccsens.tall.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* @author
*/
@Data
public class MemberDto {
@Data
@ApiModel("添加评论")
public static class SaveMember{
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("成员手机号")
private String phone;
@ApiModelProperty("所属角色的id")
private List<Long> roleId;
@ApiModelProperty("奖惩干系人id")
private Long stakeholderId;
}
}

46
tall/src/main/java/com/ccsens/tall/bean/dto/UserDto.java

@ -75,9 +75,24 @@ public class UserDto {
private String password; private String password;
} }
//注册
@Data @Data
@ApiModel @ApiModel("通过账号修改密码")
public static class UpdatePasswordByAccount{
@ApiModelProperty("账号")
@NotEmpty(message = "账号不能为空")
private String account;
@ApiModelProperty("旧密码")
@NotEmpty(message = "旧密码不能为空.")
@Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符")
private String passwordOld;
@ApiModelProperty("新密码")
@NotEmpty(message = "新密码不能为空")
@Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符")
private String passwordNew;
}
@Data
@ApiModel("手机号注册")
public static class UserSignup{ public static class UserSignup{
@ApiModelProperty("手机号") @ApiModelProperty("手机号")
@NotEmpty(message = "手机号不能为空") @NotEmpty(message = "手机号不能为空")
@ -97,9 +112,9 @@ public class UserDto {
@ApiModelProperty("来源 0:默认注册,1:HT病人注册") @ApiModelProperty("来源 0:默认注册,1:HT病人注册")
private byte source = WebConstant.Regist.SOURCE; private byte source = WebConstant.Regist.SOURCE;
} }
//注册
@Data @Data
@ApiModel @ApiModel("注册")
public static class UserSignupSystem{ public static class UserSignupSystem{
@ApiModelProperty("账号") @ApiModelProperty("账号")
private String account; private String account;
@ -144,4 +159,27 @@ public class UserDto {
@ApiModelProperty("语言") @ApiModelProperty("语言")
private String language; private String language;
} }
@Data
@ApiModel("修改登录账号")
public static class UpdateAccount{
@ApiModelProperty("手机号")
@NotEmpty(message = "手机号不能为空")
@Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号")
private String phone;
@ApiModelProperty("验证码")
@NotEmpty(message = "验证码不能为空.")
private String smsCode;
@ApiModelProperty("账号")
@NotEmpty(message = "新账号不能为空.")
private String account;
}
@Data
@ApiModel("修改昵称")
public static class UpdateNickname{
@ApiModelProperty("昵称")
@NotEmpty(message = "新昵称不能为空.")
private String nickname;
}
} }

1
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -137,6 +137,7 @@ public class SpringConfig implements WebMvcConfigurer {
.excludePathPatterns("/users/smscode") .excludePathPatterns("/users/smscode")
.excludePathPatterns("/users/signup/**") .excludePathPatterns("/users/signup/**")
.excludePathPatterns("/users/password") .excludePathPatterns("/users/password")
.excludePathPatterns("/users/password/account")
.excludePathPatterns("/users/account") .excludePathPatterns("/users/account")
.excludePathPatterns("/users/token") .excludePathPatterns("/users/token")
.excludePathPatterns("/users/claims") .excludePathPatterns("/users/claims")

2
tall/src/main/java/com/ccsens/tall/persist/dao/SysRingMsgDao.java

@ -15,4 +15,6 @@ public interface SysRingMsgDao extends SysRingMsgMapper {
List<Long> selectRoleIdByUserId(@Param("userId")Long userId, @Param("projectId")Long projectId); List<Long> selectRoleIdByUserId(@Param("userId")Long userId, @Param("projectId")Long projectId);
List<RingVo.MsgReceiveRole> ringReceiveRole(@Param("messageId")Long messageId); List<RingVo.MsgReceiveRole> ringReceiveRole(@Param("messageId")Long messageId);
List<RingVo.RingInfo> selectRingInfoByRingMsgId(@Param("userId")Long userId, @Param("projectId")Long projectId, @Param("msgId")Long msgId);
} }

8
tall/src/main/java/com/ccsens/tall/service/IProMemberService.java

@ -1,5 +1,6 @@
package com.ccsens.tall.service; package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.MemberDto;
import com.ccsens.tall.bean.po.ProMember; import com.ccsens.tall.bean.po.ProMember;
import com.ccsens.tall.bean.po.ProRole; import com.ccsens.tall.bean.po.ProRole;
import com.ccsens.tall.bean.vo.MemberVo; import com.ccsens.tall.bean.vo.MemberVo;
@ -29,4 +30,11 @@ public interface IProMemberService {
List<Long> getMemberIdByProjectId(Long projectId); List<Long> getMemberIdByProjectId(Long projectId);
MemberVo.MemberInfo getUserInfoByUserId(Long userId); MemberVo.MemberInfo getUserInfoByUserId(Long userId);
/**
* 添加成员
* @param currentUserId userId
* @param saveMember 项目id角色id成员姓名和手机号等
*/
void saveProMember(Long currentUserId, MemberDto.SaveMember saveMember) throws Exception;
} }

2
tall/src/main/java/com/ccsens/tall/service/IRingService.java

@ -12,5 +12,5 @@ public interface IRingService {
PageInfo<RingVo.RingInfo> getRingInfo(Long currentUserId, RingDto.GetRingDto getRingDto); PageInfo<RingVo.RingInfo> getRingInfo(Long currentUserId, RingDto.GetRingDto getRingDto);
void readRingMsg(Long currentUserId, RingDto.MessageId message) throws JsonProcessingException; List<RingVo.RingInfo> readRingMsg(Long currentUserId, RingDto.MessageId message) throws JsonProcessingException;
} }

32
tall/src/main/java/com/ccsens/tall/service/IUserInfoService.java

@ -0,0 +1,32 @@
package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.UserDto;
import com.ccsens.util.NotSupportedFileTypeException;
import javax.servlet.http.Part;
/**
* @author
*/
public interface IUserInfoService {
/**
* 修改登录的账号
* @param userId 用户id
* @param changeAccount 验证码和新账号
*/
void updateAccount(Long userId, UserDto.UpdateAccount changeAccount);
/**
* 修改昵称
* @param userId 用户id
* @param updateNickname 新昵称
*/
void updateNickname(Long userId, UserDto.UpdateNickname updateNickname);
/**
* 上传头像
* @param currentUserId userId
* @param file 上传的文件
*/
void uploadAvatarUrl(Long currentUserId, Part file) throws Exception;
}

24
tall/src/main/java/com/ccsens/tall/service/IUserService.java

@ -1,17 +1,19 @@
package com.ccsens.tall.service; package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.ProjectDto; import com.ccsens.tall.bean.dto.ProjectDto;
import com.ccsens.tall.bean.dto.UserDto; import com.ccsens.tall.bean.dto.UserDto;
import com.ccsens.tall.bean.po.SysUser; import com.ccsens.tall.bean.po.SysUser;
import com.ccsens.tall.bean.vo.UserVo; import com.ccsens.tall.bean.vo.UserVo;
import com.ccsens.util.WebConstant; import com.ccsens.util.WebConstant;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* @author
*/
public interface IUserService { public interface IUserService {
UserVo.UserSign signin(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType, UserVo.UserSign signin(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType,
String identifier, String credential, String clientIp, String redirect) throws Exception; String identifier, String credential, String clientIp, String redirect) throws Exception;
@ -42,8 +44,23 @@ public interface IUserService {
void updateAccount(UserDto.Account account); void updateAccount(UserDto.Account account);
/**
* 通过手机号修改密码
* @param passwordDto 手机号验证码
*/
void updatePassword(UserDto.UpdatePassword passwordDto) throws Exception; void updatePassword(UserDto.UpdatePassword passwordDto) throws Exception;
/**
* 通过账号密码修改密码
* @param passwordDto 账号旧密码和新密码
*/
void updatePasswordByAccount(UserDto.UpdatePasswordByAccount passwordDto) throws Exception;
/**
* 通过手机号查找userId
* @param phoneCell 手机号
* @return userId
*/
Long selectUserIdByPhone(String phoneCell)throws Exception; Long selectUserIdByPhone(String phoneCell)throws Exception;
String selectAccountByPhone(String phone)throws Exception; String selectAccountByPhone(String phone)throws Exception;
@ -80,4 +97,5 @@ public interface IUserService {
UserVo.Account systemRegister(UserDto.UserSignupSystem userSignup); UserVo.Account systemRegister(UserDto.UserSignupSystem userSignup);
String getUserNameByUserId(Long userId); String getUserNameByUserId(Long userId);
} }

132
tall/src/main/java/com/ccsens/tall/service/ProMemberService.java

@ -2,7 +2,10 @@ package com.ccsens.tall.service;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.ccsens.tall.bean.dto.MemberDto;
import com.ccsens.tall.bean.dto.MemberRoleDto;
import com.ccsens.tall.bean.po.*; import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.MemberVo; import com.ccsens.tall.bean.vo.MemberVo;
import com.ccsens.tall.bean.vo.ProjectVo; import com.ccsens.tall.bean.vo.ProjectVo;
@ -11,12 +14,11 @@ import com.ccsens.util.CodeEnum;
import com.ccsens.util.WebConstant; import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException; import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Member; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -24,18 +26,24 @@ import java.util.List;
@Service @Service
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class ProMemberService implements IProMemberService { public class ProMemberService implements IProMemberService {
@Autowired @Resource
private ProMemberDao proMemberDao; private ProMemberDao proMemberDao;
@Autowired @Resource
private ProRoleDao proRoleDao; private ProRoleDao proRoleDao;
@Autowired @Resource
private ProMemberRoleDao proMemberRoleDao; private ProMemberRoleDao proMemberRoleDao;
@Autowired @Resource
private IUserService userService;
@Autowired
private SysUserDao userDao; private SysUserDao userDao;
@Autowired @Resource
private SysAuthDao authDao; private SysAuthDao authDao;
@Resource
private ProRoleService proRoleService;
@Resource
private IUserService userService;
@Resource
private Snowflake snowflake;
@Resource
private UserAttentionDao userAttentionDao;
@Override @Override
@ -46,75 +54,6 @@ public class ProMemberService implements IProMemberService {
@Override @Override
public List<ProjectVo.MembersByProject> selectMembersByProjectId(Long projectId) throws Exception { public List<ProjectVo.MembersByProject> selectMembersByProjectId(Long projectId) throws Exception {
List<ProjectVo.MembersByProject> members = proMemberDao.selectMembersByProjectId(projectId); List<ProjectVo.MembersByProject> members = proMemberDao.selectMembersByProjectId(projectId);
// List<ProjectVo.MembersByProject> members = new ArrayList<>();
// ProjectVo.MembersByProject member = null;
// List<ProjectVo.MembersByProject.BelongRole> belongRoleList = null;
// ProjectVo.MembersByProject.BelongRole belongRole = null;
// ProMemberExample memberExample = new ProMemberExample();
// memberExample.createCriteria().andProjectIdEqualTo(projectId).andStakeholderIdIsNull();
// List<ProMember> memberList = proMemberDao.selectByExample(memberExample);
// if(CollectionUtil.isNotEmpty(memberList)){
// for(ProMember proMember:memberList){
// member = new ProjectVo.MembersByProject();
// member.setMemberId(proMember.getId());
// member.setName(proMember.getNickname());
// member.setPhone(proMember.getPhone());
// member.setUserId(proMember.getUserId());
// }
// }
//
// //查找所有角色
// ProRoleExample roleExample = new ProRoleExample();
// roleExample.createCriteria().andProjectIdEqualTo(projectId);
// List<ProRole> roleList = proRoleDao.selectByExample(roleExample);
// if(CollectionUtil.isNotEmpty(roleList)){
// for(ProRole role :roleList){
// if(!role.getName().equals(WebConstant.ROLE_NAME.AllMember.phase)&&!role.getName().equals(WebConstant.ROLE_NAME.MVP.phase)) {
// //查找角色下所有成员
// ProMemberRoleExample memberRoleExample = new ProMemberRoleExample();
// memberRoleExample.createCriteria().andRoleIdEqualTo(role.getId());
// List<ProMemberRole> memberRoleList = proMemberRoleDao.selectByExample(memberRoleExample);
// if(CollectionUtil.isNotEmpty(memberRoleList)){
// for (ProMemberRole memberRole:memberRoleList){
// ProMember proMember = proMemberDao.selectByPrimaryKey(memberRole.getMemberId());
// if(ObjectUtil.isNotNull(proMember)){
// boolean flag = false;
// if (CollectionUtil.isNotEmpty(members)) {
// for (ProjectVo.MembersByProject membersByProject : members) {
// if (membersByProject.getPhone().equals(proMember.getPhone())) {
// belongRole = new ProjectVo.MembersByProject.BelongRole();
// belongRole.setRoleId(role.getId());
// belongRole.setRoleName(role.getName());
// membersByProject.getBelongRole().add(belongRole);
// flag = true;
// break;
// }
// }
// }
// if (!flag) {
// member = new ProjectVo.MembersByProject();
// member.setMemberId(proMember.getId());
// member.setName(proMember.getNickname());
// member.setPhone(proMember.getPhone());
// member.setUserId(proMember.getUserId());
// String mAccount = userService.selectAccountByPhone(member.getPhone());
// member.setAccount(mAccount);
//
// belongRoleList = new ArrayList<>();
// belongRole = new ProjectVo.MembersByProject.BelongRole();
// belongRole.setRoleId(role.getId());
// belongRole.setRoleName(role.getName());
// belongRoleList.add(belongRole);
// member.setBelongRole(belongRoleList);
//
// members.add(member);
// }
// }
// }
// }
// }
// }
// }
return members; return members;
} }
@ -289,4 +228,41 @@ public class ProMemberService implements IProMemberService {
} }
return memberIdList; return memberIdList;
} }
@Override
public void saveProMember(Long currentUserId, MemberDto.SaveMember saveMember) throws Exception {
int power = proRoleService.selectPowerByRoleName(currentUserId, saveMember.getProjectId());
if (power > 1) {
//通过手机号查找用户
Long userId = userService.selectUserIdByPhone(saveMember.getPhone());
//添加成员
ProMember proMember = new ProMember();
proMember.setId(snowflake.nextId());
proMember.setProjectId(saveMember.getProjectId());
proMember.setNickname(saveMember.getMemberName());
proMember.setUserId(userId);
proMember.setStakeholderId(saveMember.getStakeholderId());
proMemberDao.insertSelective(proMember);
//添加成员与角色的关联
if(CollectionUtil.isNotEmpty(saveMember.getRoleId())){
saveMember.getRoleId().forEach(roleId -> {
ProMemberRole proMemberRole = new MemberRoleDto();
proMemberRole.setId(snowflake.nextId());
proMemberRole.setRoleId(roleId);
proMemberRole.setMemberId(proMember.getId());
proMemberRoleDao.insertSelective(proMemberRole);
});
}
//添加用户关注项目信息
if(ObjectUtil.isNotNull(userId)) {
UserAttention userAttention = new UserAttention();
userAttention.setId(snowflake.nextId());
userAttention.setUserId(userId);
userAttention.setProjectId(saveMember.getProjectId());
userAttentionDao.insertSelective(userAttention);
}
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
}
} }

75
tall/src/main/java/com/ccsens/tall/service/RingService.java

@ -27,8 +27,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.function.Consumer;
/** /**
* @author * @author
@ -36,23 +36,24 @@ import java.util.function.Consumer;
@Slf4j @Slf4j
@Service @Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class RingService implements IRingService{ public class RingService implements IRingService {
@Autowired @Resource
private Snowflake snowflake; private Snowflake snowflake;
@Autowired @Resource
private SysRingMsgDao sysRingMsgDao; private SysRingMsgDao sysRingMsgDao;
@Autowired @Resource
private SysRingSendDao sysRingSendDao; private SysRingSendDao sysRingSendDao;
@Autowired @Resource
private IUserService userService; private IUserService userService;
@Autowired @Resource
private RabbitTemplate rabbitTemplate; private RabbitTemplate rabbitTemplate;
/** /**
* 发送ring消息 * 发送ring消息
*
* @param currentUserId 当前用户userid * @param currentUserId 当前用户userid
* @param ringSendDto 发送的消息内容 * @param ringSendDto 发送的消息内容
*/ */
@Override @Override
public void sendRingMsg(Long currentUserId, RingDto.RingSendDto ringSendDto) throws Exception { public void sendRingMsg(Long currentUserId, RingDto.RingSendDto ringSendDto) throws Exception {
@ -65,17 +66,17 @@ public class RingService implements IRingService{
ringMsg.setSenderId(currentUserId); ringMsg.setSenderId(currentUserId);
ringMsg.setTime(time); ringMsg.setTime(time);
ringMsg.setValueText(ringSendDto.getValue()); ringMsg.setValueText(ringSendDto.getValue());
if(ringSendDto.getValue().length() > 20){ if (ringSendDto.getValue().length() > 20) {
ringMsg.setValue(ringSendDto.getValue().substring(0,20)); ringMsg.setValue(ringSendDto.getValue().substring(0, 20));
}else { } else {
ringMsg.setValue(ringSendDto.getValue()); ringMsg.setValue(ringSendDto.getValue());
} }
sysRingMsgDao.insertSelective(ringMsg); sysRingMsgDao.insertSelective(ringMsg);
//所有接收者的userId //所有接收者的userId
Set<Long> userIdSet = new HashSet<>(); Set<Long> userIdSet = new HashSet<>();
//添加消息详情与接收角色的关联信息 //添加消息详情与接收角色的关联信息
if(CollectionUtil.isNotEmpty(ringSendDto.getRoleList())){ if (CollectionUtil.isNotEmpty(ringSendDto.getRoleList())) {
for(Long roleId :ringSendDto.getRoleList()){ for (Long roleId : ringSendDto.getRoleList()) {
SysRingSend sysRingSend = new SysRingSend(); SysRingSend sysRingSend = new SysRingSend();
sysRingSend.setId(snowflake.nextId()); sysRingSend.setId(snowflake.nextId());
sysRingSend.setRingId(ringMsg.getId()); sysRingSend.setRingId(ringMsg.getId());
@ -88,7 +89,7 @@ public class RingService implements IRingService{
List<Long> userIdList = new ArrayList<>(userIdSet); List<Long> userIdList = new ArrayList<>(userIdSet);
//发送消息 //发送消息
RingMessageWithSendDto ringMessageWithSendDto = new RingMessageWithSendDto( RingMessageWithSendDto ringMessageWithSendDto = new RingMessageWithSendDto(
ringMsg.getId(),ringSendDto.getProjectId(),ringMsg.getValue(),time); ringMsg.getId(), ringSendDto.getProjectId(), ringMsg.getValue(), time);
ringMessageWithSendDto.setReceivers(BaseMessageDto.MessageUser.userIdToUsers(userIdList)); ringMessageWithSendDto.setReceivers(BaseMessageDto.MessageUser.userIdToUsers(userIdList));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME, rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(ringMessageWithSendDto)); JacksonUtil.beanToJson(ringMessageWithSendDto));
@ -96,8 +97,9 @@ public class RingService implements IRingService{
/** /**
* 查询ring消息 * 查询ring消息
*
* @param currentUserId userId * @param currentUserId userId
* @param getRingDto 查询条件 * @param getRingDto 查询条件
* @return 时间倒叙查询最近10条信息在返回的结果中需时间正序展示 * @return 时间倒叙查询最近10条信息在返回的结果中需时间正序展示
*/ */
@Override @Override
@ -107,18 +109,18 @@ public class RingService implements IRingService{
getRingDto.setPageSize(getRingDto.getPageSize() == null ? 10 : getRingDto.getPageSize()); getRingDto.setPageSize(getRingDto.getPageSize() == null ? 10 : getRingDto.getPageSize());
PageHelper.startPage(getRingDto.getPage(), getRingDto.getPageSize()); PageHelper.startPage(getRingDto.getPage(), getRingDto.getPageSize());
List<RingVo.RingInfo> ringInfoList = sysRingMsgDao.selectRingInfoByProject(currentUserId,getRingDto.getProjectId()); List<RingVo.RingInfo> ringInfoList = sysRingMsgDao.selectRingInfoByProject(currentUserId, getRingDto.getProjectId());
if(CollectionUtil.isNotEmpty(ringInfoList)){ if (CollectionUtil.isNotEmpty(ringInfoList)) {
ringInfoList.forEach(ringInfo -> { ringInfoList.forEach(ringInfo -> {
List<RingVo.MsgReceiveRole> msgReceiveRole = sysRingMsgDao.ringReceiveRole(ringInfo.getMessageId()); List<RingVo.MsgReceiveRole> msgReceiveRole = sysRingMsgDao.ringReceiveRole(ringInfo.getMessageId());
ringInfo.setRoleList(msgReceiveRole); ringInfo.setRoleList(msgReceiveRole);
}); });
} }
CollectionUtil.sort(ringInfoList,new Comparator<RingVo.RingInfo>(){ CollectionUtil.sort(ringInfoList, new Comparator<RingVo.RingInfo>() {
@Override @Override
public int compare(RingVo.RingInfo o1, RingVo.RingInfo o2) { public int compare(RingVo.RingInfo o1, RingVo.RingInfo o2) {
return (int)(o1.getTime() - o2.getTime()); return (int) (o1.getTime() - o2.getTime());
} }
}); });
@ -127,28 +129,30 @@ public class RingService implements IRingService{
/** /**
* 阅读消息将消息设为已读 * 阅读消息将消息设为已读
*
* @param currentUserId userId * @param currentUserId userId
* @param message 项目id和消息id可以多个同时将多个消息设为已读 * @param message 项目id和消息id可以多个同时将多个消息设为已读
*/ */
@Override @Override
public void readRingMsg(Long currentUserId, RingDto.MessageId message) throws JsonProcessingException { public List<RingVo.RingInfo> readRingMsg(Long currentUserId, RingDto.MessageId message) throws JsonProcessingException {
List<RingVo.RingInfo> ringInfoList = new ArrayList<>();
//获取当前用户在项目内的角色 //获取当前用户在项目内的角色
List<Long> roleIdList = sysRingMsgDao.selectRoleIdByUserId(currentUserId,message.getProjectId()); List<Long> roleIdList = sysRingMsgDao.selectRoleIdByUserId(currentUserId, message.getProjectId());
log.info("阅读者的角色:{}",roleIdList.toString()); log.info("阅读者的角色:{}", roleIdList.toString());
//将每条消息的状态设为已读 //将每条消息的状态设为已读
if(CollectionUtil.isNotEmpty(roleIdList) && CollectionUtil.isNotEmpty(message.getMessageIdList())){ if (CollectionUtil.isNotEmpty(roleIdList) && CollectionUtil.isNotEmpty(message.getMessageIdList())) {
for(Long roleId : roleIdList){ for (Long msgId : message.getMessageIdList()) {
for(Long msgId : message.getMessageIdList()){ for (Long roleId : roleIdList) {
//查找消息 //查找消息
SysRingMsg sysRingMsg = sysRingMsgDao.selectByPrimaryKey(msgId); SysRingMsg sysRingMsg = sysRingMsgDao.selectByPrimaryKey(msgId);
if(ObjectUtil.isNull(sysRingMsg)){ if (ObjectUtil.isNull(sysRingMsg)) {
throw new BaseException(CodeEnum.PARAM_ERROR); throw new BaseException(CodeEnum.PARAM_ERROR);
} }
SysRingSendExample sysRingSendExample = new SysRingSendExample(); SysRingSendExample sysRingSendExample = new SysRingSendExample();
sysRingSendExample.createCriteria().andRingIdEqualTo(msgId).andRoleIdEqualTo(roleId); sysRingSendExample.createCriteria().andRingIdEqualTo(msgId).andRoleIdEqualTo(roleId);
List<SysRingSend> sysRingSendList = sysRingSendDao.selectByExample(sysRingSendExample); List<SysRingSend> sysRingSendList = sysRingSendDao.selectByExample(sysRingSendExample);
if(CollectionUtil.isNotEmpty(sysRingSendList)){ if (CollectionUtil.isNotEmpty(sysRingSendList)) {
for(SysRingSend sysRingSend : sysRingSendList){ for (SysRingSend sysRingSend : sysRingSendList) {
sysRingSend.setReadStatus((byte) 1); sysRingSend.setReadStatus((byte) 1);
sysRingSend.setReadTime(System.currentTimeMillis()); sysRingSend.setReadTime(System.currentTimeMillis());
sysRingSendDao.updateByPrimaryKeySelective(sysRingSend); sysRingSendDao.updateByPrimaryKeySelective(sysRingSend);
@ -156,13 +160,24 @@ public class RingService implements IRingService{
//将已读消息返回给发送者 //将已读消息返回给发送者
List<Long> userIdList = new ArrayList<>(); List<Long> userIdList = new ArrayList<>();
userIdList.add(sysRingMsg.getSenderId()); userIdList.add(sysRingMsg.getSenderId());
RingMessageWithReadDto ringMessageWithReadDto = new RingMessageWithReadDto(msgId,message.getProjectId(),roleId); RingMessageWithReadDto ringMessageWithReadDto = new RingMessageWithReadDto(msgId, message.getProjectId(), roleId);
ringMessageWithReadDto.setReceivers(BaseMessageDto.MessageUser.userIdToUsers(userIdList)); ringMessageWithReadDto.setReceivers(BaseMessageDto.MessageUser.userIdToUsers(userIdList));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME, rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(ringMessageWithReadDto)); JacksonUtil.beanToJson(ringMessageWithReadDto));
} }
} }
//查询被读的信息返回
List<RingVo.RingInfo> ringInfos = sysRingMsgDao.selectRingInfoByRingMsgId(currentUserId, message.getProjectId(),msgId);
if (CollectionUtil.isNotEmpty(ringInfos)) {
ringInfos.forEach(ringInfo -> {
List<RingVo.MsgReceiveRole> msgReceiveRole = sysRingMsgDao.ringReceiveRole(msgId);
ringInfo.setRoleList(msgReceiveRole);
});
}
ringInfoList.addAll(ringInfos);
} }
} }
return ringInfoList;
} }
} }

150
tall/src/main/java/com/ccsens/tall/service/UserInfoService.java

@ -0,0 +1,150 @@
package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ImageUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.tall.bean.dto.UserDto;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.persist.dao.SysAuthDao;
import com.ccsens.tall.persist.dao.SysUserDao;
import com.ccsens.tall.util.TallConstant;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.Part;
import java.io.File;
import java.util.Date;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class UserInfoService implements IUserInfoService{
@Resource
private RedisUtil redisUtil;
@Resource
private SysAuthDao sysAuthDao;
@Resource
private SysUserDao sysUserDao;
@Override
public void updateAccount(Long userId, UserDto.UpdateAccount changeAccount) {
//判断验证码是否正确
if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(changeAccount.getPhone()))) {
if (changeAccount.getSmsCode().equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(changeAccount.getPhone())).toString())) {
//查找redis该账号是否正在使用
String accountKey = TallConstant.getUpdateAccount(changeAccount.getAccount());
if(redisUtil.hasKey(accountKey)){
throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT);
}
//未查到则存进redis时效一分钟
redisUtil.set(accountKey,changeAccount.getAccount(),60);
//检查数据库内账号是否存在
SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value)
.andIdentifierEqualTo(changeAccount.getAccount());
List<SysAuth> sysAuthList = sysAuthDao.selectByExample(sysAuthExample);
if(CollectionUtil.isNotEmpty(sysAuthList)){
throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT);
}
//修改账号
SysAuthExample authAccountExample = new SysAuthExample();
authAccountExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value);
List<SysAuth> authList = sysAuthDao.selectByExample(authAccountExample);
if(CollectionUtil.isNotEmpty(authList)){
authList.forEach(sysAuth -> {
sysAuth.setIdentifier(changeAccount.getAccount());
sysAuthDao.updateByPrimaryKeySelective(sysAuth);
});
}
//修改完删除redis
redisUtil.del(accountKey);
}else {
throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
}
}else {
throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
}
}
@Override
public void updateNickname(Long userId, UserDto.UpdateNickname updateNickname) {
//查找redis该昵称是否正在使用
String nicknameKey = TallConstant.getUpdateNickname(updateNickname.getNickname());
if(redisUtil.hasKey(nicknameKey)){
throw new BaseException(CodeEnum.NICKNAME_REPEAT);
}
//未查到则存进redis时效一分钟
redisUtil.set(nicknameKey,updateNickname.getNickname(),60);
//查找数据库此昵称是否存在
SysUserExample sysUserExample = new SysUserExample();
sysUserExample.createCriteria().andNicknameEqualTo(updateNickname.getNickname());
List<SysUser> userList = sysUserDao.selectByExample(sysUserExample);
if(CollectionUtil.isNotEmpty(userList)){
throw new BaseException(CodeEnum.NICKNAME_REPEAT);
}
SysUser user = sysUserDao.selectByPrimaryKey(userId);
if(ObjectUtil.isNotNull(user)){
user.setNickname(updateNickname.getNickname());
sysUserDao.updateByPrimaryKeySelective(user);
}
redisUtil.del(nicknameKey);
}
@Override
public void uploadAvatarUrl(Long currentUserId, Part file) throws Exception {
//获取文件大小
float fileSize = (float) file.getSize();
System.out.println(fileSize);
//计算出倍数
float a = (float)(80 * 1024) / fileSize;
System.out.println(a);
//限制文件格式
String allowedExts = "png,jpg,jpeg";
String original = UploadFileUtil_Servlet3.getFileNameByPart(file);
String ext = FileUtil.extName(original);
if (StrUtil.isEmpty(ext) || !allowedExts.contains(ext)){
throw new NotSupportedFileTypeException("不支持的格式类型: " + ext);
}
//创建文件目录及名字
String extraPath = DateUtil.format(new Date(), "yyyyMMdd");
//上传的文件
String temporaryFilePath = File.separator + IdUtil.simpleUUID() + "." + ext;
File temporaryFile = new File(WebConstant.UPLOAD_AVATAR_URL + extraPath + temporaryFilePath);
FileUtils.copyInputStreamToFile(file.getInputStream(), temporaryFile);
//压缩后的文件
String compressFilePath = File.separator + IdUtil.simpleUUID() + "." + ext;
File compressFile = new File(WebConstant.UPLOAD_AVATAR_URL+ extraPath + compressFilePath);
//文件大于80k则进行压缩,否则不压缩
if(a < 1) {
ImageUtil.scale(temporaryFile, compressFile, a);
}
//获取文件的压缩前的文件名
String fullPath = WebConstant.UPLOAD_PATH_AVATAR_URL + File.separator + extraPath + temporaryFilePath;
//压缩前和压缩后的文件都存在则删除压缩前的文件
if(temporaryFile.exists() && compressFile.exists()){
FileUtil.del(temporaryFile);
//压缩成功后获取压缩后的文件名
fullPath = WebConstant.UPLOAD_PATH_AVATAR_URL + File.separator + extraPath + compressFilePath;
}
//查找到当前的用户,修改头像路径信息
SysUser sysUser = sysUserDao.selectByPrimaryKey(currentUserId);
sysUser.setAvatarUrl(PropUtil.gatewayUrl + WebConstant.TALL_UPLOADS + fullPath);
sysUserDao.updateByPrimaryKeySelective(sysUser);
}
}

127
tall/src/main/java/com/ccsens/tall/service/UserService.java

@ -34,6 +34,8 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.xhtmlrenderer.css.parser.property.PrimitivePropertyBuilders; import org.xhtmlrenderer.css.parser.property.PrimitivePropertyBuilders;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -376,10 +378,10 @@ public class UserService implements IUserService {
userSignVo.setUserId(theAuth.getUserId()); userSignVo.setUserId(theAuth.getUserId());
userSignVo.setAuthId(theAuth.getId()); userSignVo.setAuthId(theAuth.getId());
} else { } else {
throw new BaseException("密码错误"); throw new BaseException(CodeEnum.PASSWORD_ERROR);
} }
} else { } else {
throw new BaseException("找不到该用户"); throw new BaseException(CodeEnum.NOT_ACCOUNT);
} }
return userSignVo; return userSignVo;
} }
@ -508,7 +510,7 @@ public class UserService implements IUserService {
/** /**
* 微信登陆后天添加用户和认证方式 * 微信登陆后天添加用户和认证方式
* *
* @return * @return 认证信息
*/ */
private SysAuth wxRegist(String identifier, String credential, WebConstant.IDENTIFY_TYPE identifyType) { private SysAuth wxRegist(String identifier, String credential, WebConstant.IDENTIFY_TYPE identifyType) {
//1.添加user //1.添加user
@ -549,19 +551,19 @@ public class UserService implements IUserService {
Long refreshTokenExpired = null; Long refreshTokenExpired = null;
switch (clientType) { switch (clientType) {
case Wxmp: //token(2hours) refreshToken(null) case Wxmp:
//tokenExpired = 3600 * 1000L * 2; //tokenExpired = 3600 * 1000L * 2;
tokenExpired = 3600 * 1000L * 24; tokenExpired = 3600 * 1000L * 24;
break; break;
case H5: //token(2hours) refreshToken(null) case H5:
// tokenExpired = 3600 * 1000L * 2; // tokenExpired = 3600 * 1000L * 2;
tokenExpired = 3600 * 1000L * 24; tokenExpired = 3600 * 1000L * 24;
break; break;
case Android: //token(2hours) refreshToken(30天) case Android:
tokenExpired = 3600 * 1000L * 2; tokenExpired = 3600 * 1000L * 2;
refreshTokenExpired = 3600 * 1000L * 24 * 30; refreshTokenExpired = 3600 * 1000L * 24 * 30;
break; break;
case IOS: //token(2hours) refreshToken(30天) case IOS:
tokenExpired = 3600 * 1000L * 2; tokenExpired = 3600 * 1000L * 2;
refreshTokenExpired = 3600 * 1000L * 24 * 30; refreshTokenExpired = 3600 * 1000L * 24 * 30;
break; break;
@ -601,7 +603,7 @@ public class UserService implements IUserService {
* 发送验证码 * 发送验证码
*/ */
@Override @Override
public UserVo.SmsCode getSignInSmsCode(String phone, Integer client) throws Exception { public UserVo.SmsCode getSignInSmsCode(String phone, Integer client) {
//获取登陆客户端类型 //获取登陆客户端类型
WebConstant.CLIENT_TYPE client_type = null; WebConstant.CLIENT_TYPE client_type = null;
if (ObjectUtil.isNotNull(client)) { if (ObjectUtil.isNotNull(client)) {
@ -809,20 +811,19 @@ public class UserService implements IUserService {
} }
@Override @Override
public boolean tokenNotExistInCache(Long authId) throws Exception { public boolean tokenNotExistInCache(Long authId) {
return !redisUtil.hasKey(RedisKeyManager.getTokenCachedKey(authId)); return !redisUtil.hasKey(RedisKeyManager.getTokenCachedKey(authId));
} }
/** /**
* 微信绑定新手机号没有账号注册 * 微信绑定新手机号没有账号注册
* *
* @param currentUserId * @param currentUserId userId
* @param wxPhone * @param wxPhone 手机号和验证码
* @return * @return 用户id和认证类型
* @throws Exception
*/ */
@Override @Override
public UserVo.UserSign bindingNewPhone(Long currentUserId, UserDto.WxBindingPhone wxPhone) throws Exception { public UserVo.UserSign bindingNewPhone(Long currentUserId, UserDto.WxBindingPhone wxPhone) {
if (isSmsCodeCorrect(wxPhone.getPhone(), wxPhone.getSmsCode())) { if (isSmsCodeCorrect(wxPhone.getPhone(), wxPhone.getSmsCode())) {
//查找该用户以前绑定的手机 //查找该用户以前绑定的手机
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
@ -833,7 +834,7 @@ public class UserService implements IUserService {
throw new BaseException(CodeEnum.ALREADY_BINDING_PHONE); throw new BaseException(CodeEnum.ALREADY_BINDING_PHONE);
} else { } else {
//改手机对应账户,如果有,提示 //改手机对应账户,如果有,提示
List<SysAuth> phoneList = null; List<SysAuth> phoneList;
SysAuth theAuth = null; SysAuth theAuth = null;
SysAuthExample phoneExample = new SysAuthExample(); SysAuthExample phoneExample = new SysAuthExample();
phoneExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) phoneExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value)
@ -842,7 +843,6 @@ public class UserService implements IUserService {
if (CollectionUtil.isNotEmpty(phoneList)) { if (CollectionUtil.isNotEmpty(phoneList)) {
throw new BaseException(CodeEnum.MERGE_WX_PHONE); throw new BaseException(CodeEnum.MERGE_WX_PHONE);
} else { } else {
// throw new BaseException(CodeEnum.NOT_REGISTER);
//绑定 添加auth //绑定 添加auth
SysAuth auth = new SysAuth(); SysAuth auth = new SysAuth();
auth.setId(snowflake.nextId()); auth.setId(snowflake.nextId());
@ -920,8 +920,8 @@ public class UserService implements IUserService {
/** /**
* 判断验证码是否有效 * 判断验证码是否有效
*/ */
private Boolean isSmsCodeCorrect(String phone, String smsCode) throws Exception { private Boolean isSmsCodeCorrect(String phone, String smsCode) {
Boolean correct = false; boolean correct = false;
if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(phone))) { if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(phone))) {
if (smsCode.equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(phone)).toString())) { if (smsCode.equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(phone)).toString())) {
correct = true; correct = true;
@ -950,25 +950,48 @@ public class UserService implements IUserService {
auth.setCredential(ShiroKit.md5(passwordDto.getPassword(), auth.getSalt())); auth.setCredential(ShiroKit.md5(passwordDto.getPassword(), auth.getSalt()));
authDao.updateByPrimaryKeySelective(auth); authDao.updateByPrimaryKeySelective(auth);
} else { } else {
throw new BaseException("新密码不能和旧密码相同"); throw new BaseException(CodeEnum.NEW_PASSWORD_REPEAT_OLD);
} }
} else { } else {
throw new BaseException("该手机号未绑定账号"); throw new BaseException(CodeEnum.PHONE_ERR);
} }
} else { } else {
throw new BaseException("该手机号未注册"); throw new BaseException(CodeEnum.PHONE_ERR);
} }
} else { } else {
throw new BaseException("验证信息错误"); throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
} }
} }
} }
@Override
public void updatePasswordByAccount(UserDto.UpdatePasswordByAccount passwordDto) throws Exception{
if (passwordDto.getPasswordOld().equalsIgnoreCase(passwordDto.getPasswordNew())){
throw new BaseException(CodeEnum.NEW_PASSWORD_REPEAT_OLD);
}
//检查账号和密码是否正确
SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria()
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value)
.andIdentifierEqualTo(passwordDto.getAccount());
List<SysAuth> authList = authDao.selectByExample(authExample);
if (CollectionUtil.isEmpty(authList)) {
throw new BaseException(CodeEnum.NOT_ACCOUNT);
}
SysAuth sysAuth = authList.get(0);
if (ShiroKit.authenticate(passwordDto.getPasswordOld(), sysAuth.getCredential(), sysAuth.getSalt())) {
//修改密码
sysAuth.setCredential(ShiroKit.md5(passwordDto.getPasswordNew(), sysAuth.getSalt()));
authDao.updateByPrimaryKeySelective(sysAuth);
} else {
throw new BaseException(CodeEnum.PASSWORD_ERROR);
}
}
/** /**
* 通过用户查找手机号 * 通过用户查找手机号
* * @param userId userId
* @param userId * @return 用户名
* @return
*/ */
@Override @Override
public String getPhone(Long userId) { public String getPhone(Long userId) {
@ -1031,36 +1054,25 @@ public class UserService implements IUserService {
if(ObjectUtil.isNull(role)){ if(ObjectUtil.isNull(role)){
return null; return null;
} }
List<Long> userIdList = new ArrayList<>(); List<Long> userIdList;
if(role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)){ if(role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)){
userIdList = memberRoleDao.selectUserIdByProjectId(role.getProjectId()); userIdList = memberRoleDao.selectUserIdByProjectId(role.getProjectId());
}else { }else {
userIdList = memberRoleDao.selectUserIdByRoleId(roleId); userIdList = memberRoleDao.selectUserIdByRoleId(roleId);
} }
// List<Long> userIdList = new ArrayList<>();
// ProMemberRoleExample proMemberRoleExample = new ProMemberRoleExample();
// proMemberRoleExample.createCriteria().andRoleIdEqualTo(roleId);
// List<ProMemberRole> memberRoleList = memberRoleDao.selectByExample(proMemberRoleExample);
// if (CollectionUtil.isNotEmpty(memberRoleList)) {
// for (ProMemberRole memberRole : memberRoleList) {
// ProMember member = memberDao.selectByPrimaryKey(memberRole.getMemberId());
// Long userId = member.getUserId();
// userIdList.add(userId);
// }
// }
return userIdList; return userIdList;
} }
/** /**
* 查询用户是否关注此项目 * 查询用户是否关注此项目
* *
* @param currentUserId * @param currentUserId userId
* @param projectId * @param projectId 项目id
* @return * @return 是否关注此项目
*/ */
@Override @Override
public Boolean getIsAttention(Long currentUserId, Long projectId) { public Boolean getIsAttention(Long currentUserId, Long projectId) {
Boolean isAttention = false; boolean isAttention = false;
if (ObjectUtil.isNotNull(sysProjectDao.selectByPrimaryKey(projectId))) { if (ObjectUtil.isNotNull(sysProjectDao.selectByPrimaryKey(projectId))) {
UserAttentionExample attentionExample = new UserAttentionExample(); UserAttentionExample attentionExample = new UserAttentionExample();
attentionExample.createCriteria().andProjectIdEqualTo(projectId).andUserIdEqualTo(currentUserId); attentionExample.createCriteria().andProjectIdEqualTo(projectId).andUserIdEqualTo(currentUserId);
@ -1077,8 +1089,8 @@ public class UserService implements IUserService {
/** /**
* 用户关注某个项目 * 用户关注某个项目
* *
* @param currentUserId * @param currentUserId userId
* @param projectIdDto * @param projectIdDto 项目id
*/ */
@Override @Override
public void userAttentionProject(Long currentUserId, ProjectDto.ProjectIdDto projectIdDto) { public void userAttentionProject(Long currentUserId, ProjectDto.ProjectIdDto projectIdDto) {
@ -1122,12 +1134,6 @@ public class UserService implements IUserService {
log.info("用户已存在,直接返回user"); log.info("用户已存在,直接返回user");
return userDao.selectByPrimaryKey(authList.get(0).getUserId()).getId(); return userDao.selectByPrimaryKey(authList.get(0).getUserId()).getId();
} }
// int i = 0;
// 用户已存在 = true
// boolean userExist = userService.findAccount(signup.getAccount());
// while (userExist) {
// userExist = userService.findAccount(signup.getAccount() + "_" + (++i));
// }
UserDto.UserSignup up = new UserDto.UserSignup(); UserDto.UserSignup up = new UserDto.UserSignup();
up.setAccount(signup.getAccount()); up.setAccount(signup.getAccount());
up.setPassword(WebConstant.Regist.PASSWORD); up.setPassword(WebConstant.Regist.PASSWORD);
@ -1165,8 +1171,8 @@ public class UserService implements IUserService {
/** /**
* 通过userId查找账号 * 通过userId查找账号
* @param userId * @param userId userId
* @return * @return 账号
*/ */
private String selectAccountByUserId(Long userId) { private String selectAccountByUserId(Long userId) {
String account = null; String account = null;
@ -1212,9 +1218,9 @@ public class UserService implements IUserService {
/** /**
* 合并账号 * 合并账号
* *
* @param currentUserId * @param currentUserId userId
* @param wxPhone * @param wxPhone 手机号和合并方式
* @return * @return 用户id
*/ */
@Override @Override
public UserVo.UserSign mergeByPhone(Long currentUserId, UserDto.WxMergePhone wxPhone) { public UserVo.UserSign mergeByPhone(Long currentUserId, UserDto.WxMergePhone wxPhone) {
@ -1237,16 +1243,16 @@ public class UserService implements IUserService {
userDao.replaceAuth(userId, currentUserId); userDao.replaceAuth(userId, currentUserId);
//查询所有关联userId的数据库表 auth表 attention表 balance表 project表 member表 DeliverPostLog表 proLog表 //查询所有关联userId的数据库表 auth表 attention表 balance表 project表 member表 DeliverPostLog表 proLog表
//依次将查出的数据的旧userId 替换成新的userId //依次将查出的数据的旧userId 替换成新的userId
userDao.replaceProject(userId, currentUserId);
userDao.replaceAttention(userId, currentUserId); userDao.replaceAttention(userId, currentUserId);
userDao.replaceBalance(userId, currentUserId); userDao.replaceBalance(userId, currentUserId);
userDao.replaceProject(userId, currentUserId);
userDao.replaceMember(userId, currentUserId); userDao.replaceMember(userId, currentUserId);
userDao.replaceDeliverPostLog(userId, currentUserId); userDao.replaceDeliverPostLog(userId, currentUserId);
userDao.replaceProLog(userId, currentUserId); userDao.replaceProLog(userId, currentUserId);
userDao.replaceComment(userId, currentUserId); userDao.replaceComment(userId, currentUserId);
//将以前的余额添加至此账号 //将以前的余额添加至此账号
SysUser oldUser = userDao.selectByPrimaryKey(userId);
SysUser newUser = userDao.selectByPrimaryKey(currentUserId); SysUser newUser = userDao.selectByPrimaryKey(currentUserId);
SysUser oldUser = userDao.selectByPrimaryKey(userId);
if(ObjectUtil.isNotNull(oldUser) && ObjectUtil.isNotNull(newUser)) { if(ObjectUtil.isNotNull(oldUser) && ObjectUtil.isNotNull(newUser)) {
updateBalance(oldUser, newUser); updateBalance(oldUser, newUser);
} }
@ -1335,7 +1341,7 @@ public class UserService implements IUserService {
*/ */
@Override @Override
public UserVo.WxInfo updateUserInfo(Long currentUserId, UserDto.WxInfo userInfo) { public UserVo.WxInfo updateUserInfo(Long currentUserId, UserDto.WxInfo userInfo) {
//通过userid查找到用户 //通过userId查找到用户
SysUser user = userDao.selectByPrimaryKey(currentUserId); SysUser user = userDao.selectByPrimaryKey(currentUserId);
if (ObjectUtil.isNull(user)) { if (ObjectUtil.isNull(user)) {
throw new BaseException(CodeEnum.NOT_LOGIN); throw new BaseException(CodeEnum.NOT_LOGIN);
@ -1393,12 +1399,11 @@ public class UserService implements IUserService {
/** /**
* 更改绑定手机号不要密码 * 更改绑定手机号不要密码
* *
* @param userId * @param userId userId
* @param phoneInfo * @param phoneInfo 手机号和验证码
* @throws Exception
*/ */
@Override @Override
public UserVo.UserSign changePhoneNotPassword(Long userId, UserDto.WxBindingPhone phoneInfo) throws Exception { public UserVo.UserSign changePhoneNotPassword(Long userId, UserDto.WxBindingPhone phoneInfo) {
UserVo.UserSign userSign = null; UserVo.UserSign userSign = null;
if (isSmsCodeCorrect(phoneInfo.getPhone(), phoneInfo.getSmsCode())) { if (isSmsCodeCorrect(phoneInfo.getPhone(), phoneInfo.getSmsCode())) {
//查找新手机号的的绑定信息 //查找新手机号的的绑定信息

12
tall/src/main/java/com/ccsens/tall/util/TallConstant.java

@ -5,6 +5,11 @@ package com.ccsens.tall.util;
*/ */
public class TallConstant { public class TallConstant {
/*** redis key: 修改账号*/
public static final String UPDATE_ACCOUNT = "update_account_";
/*** redis key: 修改账号*/
public static final String UPDATE_NICKNAME = "update_nickname_";
/** /**
* 接口发送的信息模板 * 接口发送的信息模板
* @param operateType 接口code * @param operateType 接口code
@ -14,4 +19,11 @@ public class TallConstant {
return "operate_type_" + operateType; return "operate_type_" + operateType;
} }
public static String getUpdateAccount(String account){
return UPDATE_ACCOUNT + account;
}
public static String getUpdateNickname(String nickname){
return UPDATE_ACCOUNT + nickname;
}
} }

2
tall/src/main/java/com/ccsens/tall/web/ExcelController.java

@ -1,7 +1,6 @@
package com.ccsens.tall.web; package com.ccsens.tall.web;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.bean.vo.ProjectVo; import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.service.IExcelService; import com.ccsens.tall.service.IExcelService;
import com.ccsens.tall.service.IExportWbsService; import com.ccsens.tall.service.IExportWbsService;
@ -20,7 +19,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part; import javax.servlet.http.Part;
import java.io.File; import java.io.File;
import java.util.List;
@Api(tags = "Excel" , description = "") @Api(tags = "Excel" , description = "")
@RestController @RestController

38
tall/src/main/java/com/ccsens/tall/web/MemberController.java

@ -0,0 +1,38 @@
package com.ccsens.tall.web;
import com.ccsens.tall.bean.dto.MemberDto;
import com.ccsens.tall.bean.dto.MemberRoleDto;
import com.ccsens.tall.bean.dto.RingDto;
import com.ccsens.tall.service.IProMemberService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/**
* @author
*/
@Api(tags = "成员操作相关api" )
@RestController
@RequestMapping("/member")
public class MemberController {
@Resource
private IProMemberService proMemberService;
@ApiOperation(value = "添加角色",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse saveMember(HttpServletRequest request,
@ApiParam @Validated @RequestBody MemberDto.SaveMember saveMember) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
proMemberService.saveProMember(currentUserId,saveMember);
return JsonResponse.newInstance().ok();
}
}

6
tall/src/main/java/com/ccsens/tall/web/RingController.java

@ -56,11 +56,11 @@ public class RingController {
@ApiImplicitParams({ @ApiImplicitParams({
}) })
@RequestMapping(value = "/read", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/read", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse readRingMsg(HttpServletRequest request, public JsonResponse<List<RingVo.RingInfo>> readRingMsg(HttpServletRequest request,
@ApiParam @Validated @RequestBody RingDto.MessageId message) throws Exception { @ApiParam @Validated @RequestBody RingDto.MessageId message) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
ringService.readRingMsg(currentUserId,message); List<RingVo.RingInfo> ringInfoList = ringService.readRingMsg(currentUserId,message);
return JsonResponse.newInstance().ok(); return JsonResponse.newInstance().ok(ringInfoList);
} }
} }

12
tall/src/main/java/com/ccsens/tall/web/UserController.java

@ -240,7 +240,7 @@ public class UserController {
return JsonResponse.newInstance().ok(wxInfo); return JsonResponse.newInstance().ok(wxInfo);
} }
@ApiOperation(value = "修改密码", notes = "") @ApiOperation(value = "通过手机号修改密码", notes = "")
@ApiImplicitParams({ @ApiImplicitParams({
}) })
@RequestMapping(value = "/password", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/password", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
@ -250,6 +250,16 @@ public class UserController {
return JsonResponse.newInstance().ok(); return JsonResponse.newInstance().ok();
} }
@ApiOperation(value = "通过账号密码修改密码", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/password/account", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updatePasswordByAccount(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdatePasswordByAccount passwordDto) throws Exception {
userService.updatePasswordByAccount(passwordDto);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "解绑手机号", notes = "") @ApiOperation(value = "解绑手机号", notes = "")
@ApiImplicitParams({ @ApiImplicitParams({
}) })

70
tall/src/main/java/com/ccsens/tall/web/UserInfoController.java

@ -0,0 +1,70 @@
package com.ccsens.tall.web;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ImageUtil;
import com.ccsens.tall.bean.dto.UserDto;
import com.ccsens.tall.service.IUserInfoService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.UploadFileUtil_Servlet3;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import org.apache.commons.io.FileUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
import java.awt.*;
import java.io.File;
/**
* @author
*/
@Api(tags = "用户详细信息操作API")
@RestController
@RequestMapping("/users/info")
public class UserInfoController {
@Resource
private IUserInfoService userInfoService;
@ApiOperation(value = "修改登录账号")
@ApiImplicitParams({
})
@RequestMapping(value = "/account", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateAccount(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdateAccount updateAccount) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userInfoService.updateAccount(currentUserId, updateAccount);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "修改昵称")
@ApiImplicitParams({
})
@RequestMapping(value = "/nickname", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateNickname(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdateNickname updateNickname) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userInfoService.updateNickname(currentUserId, updateNickname);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "上传头像")
@ApiImplicitParams({
})
@RequestMapping(value = "/avatarUrl", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse uploadAvatarUrl(HttpServletRequest request,
@ApiParam @Validated @RequestBody Part file) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userInfoService.uploadAvatarUrl(currentUserId,file);
return JsonResponse.newInstance().ok();
}
}

1
tall/src/main/resources/application-dev.yml

@ -29,6 +29,7 @@ spring:
timeout: 1000ms timeout: 1000ms
swagger: swagger:
enable: true enable: true
gatewayUrl: https://test.tall.wiki/gateway/
notGatewayUrl: /home/staticrec/logo.png notGatewayUrl: /home/staticrec/logo.png
wx: wx:
prefixUrl: https://test.tall.wiki/wxconfigurer-api/ prefixUrl: https://test.tall.wiki/wxconfigurer-api/

10
tall/src/main/resources/application-test.yml

@ -32,9 +32,11 @@ swagger:
enable: true enable: true
eureka: eureka:
instance: instance:
ip-address: 192.168.0.99 # ip-address: 192.168.0.99
# ip-address: 49.233.89.188 ip-address: 49.233.89.188
gatewayUrl: http://192.168.0.99/gateway/ #gatewayUrl: http://192.168.0.99/gateway/
notGatewayUrl: http://192.168.0.99/ #notGatewayUrl: http://192.168.0.99/
gatewayUrl: https://test.tall.wiki/gateway/
notGatewayUrl: https://test.tall.wiki/
wx: wx:
prefixUrl: https://test.tall.wiki/wxconfigurer-api prefixUrl: https://test.tall.wiki/wxconfigurer-api

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: dev active: test
include: util-dev,common include: util-test,common

8
tall/src/main/resources/druid-test.yml

@ -15,8 +15,8 @@ spring:
maxWait: 60000 maxWait: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
minIdle: 5 minIdle: 5
# password: password:
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 # password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true poolPreparedStatements: true
servletLogSlowSql: true servletLogSlowSql: true
servletLoginPassword: 111111 servletLoginPassword: 111111
@ -28,8 +28,8 @@ spring:
testOnReturn: false testOnReturn: false
testWhileIdle: true testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
# url: jdbc:mysql://127.0.0.1/tall?useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://127.0.0.1/tall?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://test.tall.wiki/tall?useUnicode=true&characterEncoding=UTF-8 # url: jdbc:mysql://test.tall.wiki/tall?useUnicode=true&characterEncoding=UTF-8
username: root username: root
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL env: CCSENS_TALL

2
tall/src/main/resources/mapper_dao/SysOperationDao.xml

@ -38,7 +38,7 @@
AND s.receiver_id = #{userId} AND s.receiver_id = #{userId}
AND s.send_type = #{sendType} AND s.send_type = #{sendType}
AND s.init_read =0 AND s.init_read =0
AND s.rec_status = 0e AND s.rec_status = 0
AND o.rec_status = 0 AND o.rec_status = 0
</select> </select>
<select id="queryMsg" resultMap="MessageQuery"> <select id="queryMsg" resultMap="MessageQuery">

56
tall/src/main/resources/mapper_dao/SysRingMsgDao.xml

@ -98,4 +98,60 @@
m.id = #{messageId} m.id = #{messageId}
</select> </select>
<select id="selectRingInfoByRingMsgId" parameterType="java.util.Map" resultMap="ring_message">
SELECT
*
FROM
(
SELECT
m.id as messageId,
m.`value` as `value`,
m.`value_text` as `valueText`,
m.`time` as time,
if(m.sender_id = #{userId},1,0) as mine,
m.sender_id as senderId,
(
SELECT
IF( u.nickname = '', a.identifier, u.nickname ) AS userName
FROM
t_sys_user u
LEFT JOIN t_sys_auth a ON u.id = a.user_id
AND a.identify_type = 3
WHERE
u.rec_status = 0
and
a.rec_status = 0
and
u.id = m.sender_id
limit 1
) as senderName,
(SELECT count(read_status) FROM t_sys_ring_send WHERE ring_id = m.id and read_status = 0) as unread
FROM
t_sys_ring_msg m LEFT JOIN t_sys_ring_send s on m.id = s.ring_id
WHERE
(
m.sender_id = #{userId}
or
s.role_id in (
SELECT
r.id as rId
FROM
t_pro_role r LEFT JOIN t_pro_member_role mr on r.id = mr.role_id
LEFT JOIN t_pro_member m on mr.member_id = m.id
WHERE
(m.user_id = #{userId}
or
r.`name` = '全体成员'
)
AND
r.project_id = #{projectId}
)
)
and
m.id = #{msgId}
GROUP BY m.id
)a
ORDER BY a.time DESC
</select>
</mapper> </mapper>

6
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -116,7 +116,11 @@ public enum CodeEnum {
NOT_COMMENT(98,"该评论不存在",true), NOT_COMMENT(98,"该评论不存在",true),
NOT_MESSAGE_TYPE(99,"找不到消息类型,请检查名称是否正确",true), NOT_MESSAGE_TYPE(99,"找不到消息类型,请检查名称是否正确",true),
NOT_LABEL(100,"标签不存在,请检查后操作",true), NOT_LABEL(100,"标签不存在,请检查后操作",true),
REPEAT_LABEL(100,"标签已存在,请勿重复添加",true), REPEAT_LABEL(101,"标签已存在,请勿重复添加",true),
NICKNAME_REPEAT(102,"改名字已经存在,请换一个再试",true),
NEW_PASSWORD_REPEAT_OLD(103,"新密码不能和旧密码相同",true),
PASSWORD_ERROR(104,"密码错误",true),
NOT_ACCOUNT(105,"未找到该账号",true),
; ;
public CodeEnum addMsg(String msg){ public CodeEnum addMsg(String msg){

3
util/src/main/java/com/ccsens/util/UploadFileUtil_Servlet3.java

@ -2,6 +2,7 @@ package com.ccsens.util;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
@ -36,7 +37,7 @@ public class UploadFileUtil_Servlet3 {
if (StrUtil.isEmpty(ext) || !allowedExts.contains(ext)){ if (StrUtil.isEmpty(ext) || !allowedExts.contains(ext)){
throw new NotSupportedFileTypeException("不支持的格式类型: " + ext); throw new NotSupportedFileTypeException("不支持的格式类型: " + ext);
} }
String path = extraPath + File.separator + SecureUtil.simpleUUID() + "." + ext; String path = extraPath + File.separator + IdUtil.simpleUUID() + "." + ext;
//3.创建必要的目录 //3.创建必要的目录
File tmpFile = new File(dir); File tmpFile = new File(dir);
if (!tmpFile.exists()) { if (!tmpFile.exists()) {

5
util/src/main/java/com/ccsens/util/WebConstant.java

@ -119,14 +119,17 @@ public class WebConstant {
public static final String UPLOAD_PATH_DELIVER = UPLOAD_PATH_BASE + File.separator + "delivers"; public static final String UPLOAD_PATH_DELIVER = UPLOAD_PATH_BASE + File.separator + "delivers";
public static final String UPLOAD_PATH_DELIVER1 ="delivers"; public static final String UPLOAD_PATH_DELIVER1 ="delivers";
public static final String UPLOAD_PATH_AVATAR_URL ="avatarUrl";
public static final String UPLOAD_PATH_REMARK ="remarks"; public static final String UPLOAD_PATH_REMARK ="remarks";
public static final String UPLOAD_PROJECT_WBS = UPLOAD_PATH_BASE + File.separator + "project"; public static final String UPLOAD_PROJECT_WBS = UPLOAD_PATH_BASE + File.separator + "project";
public static final String UPLOAD_AVATAR_URL = UPLOAD_PATH_BASE + File.separator + "avatarUrl/";
public static final String URL_BASE = "https://api.ccsens.com/ptpro/uploads/"; public static final String URL_BASE = "https://api.ccsens.com/ptpro/uploads/";
public static final String TEST_URL = "https://test.tall.wiki/"; public static final String TEST_URL = "https://test.tall.wiki/";
public static final String TEST_URL_GAME_SQ = TEST_URL + "game-dev/"; public static final String TEST_URL_GAME_SQ = TEST_URL + "game-dev/";
public static final String TEST_URL_GAME_SP = TEST_URL + "game-sp/"; public static final String TEST_URL_GAME_SP = TEST_URL + "game-sp/";
public static final String TEST_URL_GAME_BH = TEST_URL + "game-bh/"; public static final String TEST_URL_GAME_BH = TEST_URL + "game-bh/";
public static final String TEST_URL_BASE = TEST_URL + "gateway/tall/v1.0/uploads/"; public static final String TALL_UPLOADS = "tall/v1.0/uploads/";
public static final String TEST_URL_BASE = TEST_URL + "gateway/" + TALL_UPLOADS;
public static final String TEST_URL_BASE_MT = TEST_URL + "gateway/mt/uploads/"; public static final String TEST_URL_BASE_MT = TEST_URL + "gateway/mt/uploads/";
public static final String TEST_URL_BASE_HEALTH = TEST_URL + "gateway/health/uploads/"; public static final String TEST_URL_BASE_HEALTH = TEST_URL + "gateway/health/uploads/";

Loading…
Cancel
Save