add reg or login logic .

This commit is contained in:
Carl 2022-01-25 16:41:29 +08:00
parent f219facc4c
commit b7b9f99faf
5 changed files with 28 additions and 2 deletions

View File

@ -21,7 +21,7 @@ public class MemberService {
public String memberGet(MemberGetEntity memberGetEntity, HttpServletRequest request)throws Exception { public String memberGet(MemberGetEntity memberGetEntity)throws Exception {
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity); Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(memberGetEntity);
paramMap.put("id",StringUtil.toString(memberGetEntity.getId()).equals("0")?null:StringUtil.toString(memberGetEntity.getId())); paramMap.put("id",StringUtil.toString(memberGetEntity.getId()).equals("0")?null:StringUtil.toString(memberGetEntity.getId()));
MapRemoveNullUtil.removeNullEntry(paramMap); MapRemoveNullUtil.removeNullEntry(paramMap);

View File

@ -6,6 +6,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import net.lab1024.smartadmin.common.anno.OperateLog; import net.lab1024.smartadmin.common.anno.OperateLog;
import net.lab1024.smartadmin.common.constant.ResponseCodeConst;
import net.lab1024.smartadmin.common.domain.ResponseDTO; import net.lab1024.smartadmin.common.domain.ResponseDTO;
import net.lab1024.smartadmin.common.heartbeat.StringUtil; import net.lab1024.smartadmin.common.heartbeat.StringUtil;
import net.lab1024.smartadmin.constant.SwaggerTagConst; import net.lab1024.smartadmin.constant.SwaggerTagConst;
@ -32,6 +33,7 @@ import net.lab1024.smartadmin.util.SmartHttpUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -78,7 +80,7 @@ public class TransitionController {
switch (type) switch (type)
{ {
case "get": case "get":
result = memberService.memberGet(objectMapper.convertValue(object,MemberGetEntity.class),request); result = memberService.memberGet(objectMapper.convertValue(object,MemberGetEntity.class));
break; break;
case "check": case "check":
result = memberService.memberCheck(objectMapper.convertValue(object,MemberCheckEntity.class)); result = memberService.memberCheck(objectMapper.convertValue(object,MemberCheckEntity.class));
@ -101,6 +103,26 @@ public class TransitionController {
return result; return result;
} }
@ApiOperation(value = "登录或注册", notes = "会员查询,登录注册")
@PostMapping("royalcanin/regOrLogin")
public ResponseDTO<String> regOrLogin(@RequestParam String phoneNumber) throws Exception {
MemberCheckEntity memberCheckEntity = new MemberCheckEntity();
memberCheckEntity.setMobile(phoneNumber);
JSONObject jsonObject = JSONObject.parseObject(memberService.memberCheck(memberCheckEntity));
if(jsonObject.getString("code").equals("103")){
MemberGetEntity memberGetEntity = new MemberGetEntity ();
memberGetEntity.setMobile(phoneNumber);
return ResponseDTO.succData(memberService.memberGet(memberGetEntity),"1");
}else if(jsonObject.getString("code").equals("0")){
MemberAddEntity memberAddEntity = new MemberAddEntity();
memberAddEntity.setMobile(phoneNumber);
return ResponseDTO.succData(memberService.memberAdd(memberAddEntity),"2");
}else{
return ResponseDTO.wrap(ResponseCodeConst.ERROR_PARAM);
}
}
@ApiOperation(value = "会员地址", notes = "查询会员地址,添加会员地址,更新会员地址,删除会员地址") @ApiOperation(value = "会员地址", notes = "查询会员地址,添加会员地址,更新会员地址,删除会员地址")
@PostMapping("royalcanin/memberAddress") @PostMapping("royalcanin/memberAddress")
public String transferMemberAddress(String type ,@RequestBody Object object, HttpServletRequest request) throws Exception { public String transferMemberAddress(String type ,@RequestBody Object object, HttpServletRequest request) throws Exception {

View File

@ -34,4 +34,6 @@ public class GoodsEntity {
private int isSales; private int isSales;
private int isShow; private int isShow;
private String goodUrl;
} }

View File

@ -19,6 +19,7 @@
tagUsedAge, tagUsedAge,
category_name, category_name,
picture, picture,
good_url,
show_img_file show_img_file
from t_good_goods from t_good_goods
where isShow = 1 where isShow = 1

View File

@ -1640,6 +1640,7 @@ CREATE TABLE `t_good_goods` (
`tagUsedAge` varchar(11) DEFAULT NULL COMMENT '适用阶段', `tagUsedAge` varchar(11) DEFAULT NULL COMMENT '适用阶段',
`picture` varchar(200) DEFAULT NULL COMMENT '标品头图', `picture` varchar(200) DEFAULT NULL COMMENT '标品头图',
`show_img_file` varchar(200) DEFAULT NULL COMMENT '身体头图', `show_img_file` varchar(200) DEFAULT NULL COMMENT '身体头图',
`good_url` varchar(500) DEFAULT NULL COMMENT '处方粮跳转连接',
`isSales` int(11) DEFAULT NULL COMMENT '0:未销售1销售', `isSales` int(11) DEFAULT NULL COMMENT '0:未销售1销售',
`isShow` int(11) DEFAULT NULL COMMENT '0:不展示1展示', `isShow` int(11) DEFAULT NULL COMMENT '0:不展示1展示',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)