mirror of
https://gitee.com/mmsAdmin/mms
synced 2025-12-06 08:58:55 +08:00
新增:文档模块
This commit is contained in:
parent
d91b4b1d26
commit
9d05f670b8
284
mms-docs/mms-doc-api/README.md
Normal file
284
mms-docs/mms-doc-api/README.md
Normal file
@ -0,0 +1,284 @@
|
||||
# 声明
|
||||
|
||||
本项目是用于 [[VitePress 会员主题]](https://vitepress.mosong.cc/) 的用户注册/登录,支付等接口服务。
|
||||
|
||||
> 详细文档大家请访问: 官方 [[VitePress 会员主题]](https://vitepress.mosong.cc/) 官方是Go语言服务接口工程 。
|
||||
|
||||
> 以下是用Java扩展 ‘会员主题’ 服务接口,具体看下面的接口列表:
|
||||
|
||||
|
||||
# 接口列表
|
||||
|
||||
## 一、用户信息
|
||||
|
||||
POST /vpapi/meb/userinfo
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称|位置|类型|必选| 值 |
|
||||
|---|---|---|---|------------|
|
||||
|cookie|header|string| 否 | mss= |
|
||||
|
||||
> 返回示例
|
||||
|
||||
未登录
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"会话过期",
|
||||
"errno":"99910",
|
||||
"host_time":"20250528093635"
|
||||
}
|
||||
```
|
||||
已登录
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"uid": "674fe3bb2c8b61045f6eaff6",
|
||||
"nickname": "单先生-软件开发",
|
||||
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/gWYQezqOl40WauDqyA7c5HGPQQgUQmXg0aLJVhMwdAIxD2DHs19urHkzB5CJm12vraHGT9a1lQIBNyGYBzCJ4yJuib8bctnE9rS5CH9GY3NY/132",
|
||||
"ctime": "20241204130811",
|
||||
"type": "vip",
|
||||
"vip_date": "2025-05-28"
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528095709"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 二、获取登录二维码
|
||||
|
||||
POST /vpapi/meb/oauth-authorize
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称|位置|类型|必选| 值 |
|
||||
|---|---|---|---|---|
|
||||
|cookie|header|string| 否 | mss= |
|
||||
|
||||
> 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"state": "68366991f2d7af56647fb645",
|
||||
"url": "https://vpapi.mosong.cc/vpapi/meb/weixin-authorize?scope=snsapi_userinfo&state=68366991f2d7af56647fb645"
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528094033"
|
||||
}
|
||||
```
|
||||
|
||||
## 三、微信授权跳转
|
||||
|
||||
GET /vpapi/meb/weixin-authorize?state=x&scope=x
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称|位置|类型|必选| 值 |
|
||||
|---|---|---|---|---|
|
||||
|cookie|header|string| 否 | mss= |
|
||||
|state| param |string| 是 | 68366991f2d7af56647fb645 |
|
||||
|scope| param |string| 是 | snsapi_userinfo |
|
||||
|
||||
> 返回示例
|
||||
> '状态 1=正常 0=重试'
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"status":1
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528094033"
|
||||
}
|
||||
```
|
||||
|
||||
## 四、查询扫码状态
|
||||
|
||||
POST /vpapi/meb/oauth-polling
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---|
|
||||
|cookie| header |string| 否 | mss= |
|
||||
|state| param |string| 是 | 68366991f2d7af56647fb645 |
|
||||
|
||||
|
||||
> 返回示例
|
||||
|
||||
未扫码
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"status": "0",
|
||||
"token": ""
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528094039"
|
||||
}
|
||||
```
|
||||
扫码成功
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"status": "1",
|
||||
"token": "3092447f3f26snCUIBpCShl3_kRxkaJsephz_DfFtPWtrFNCz6IiMAjYYlU1bN1YbQ9Vs_3HFCUGYzRlSoE-eKGpPmFsTBlxIjGueCALtm3wkn9grjM6UPFC_C8W5sgCAZLIdOLvLYwu"
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528095709"
|
||||
}
|
||||
```
|
||||
|
||||
## 五、开通会员
|
||||
|
||||
POST /vpapi/meb/product-list
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|
||||
|
||||
> 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"body": {
|
||||
"items": [
|
||||
{
|
||||
"prod_id": "240003",
|
||||
"prod_name": "天卡会员",
|
||||
"unit_price": 990,
|
||||
"mark_price": 990,
|
||||
"intro": "",
|
||||
"buy_url": "付款二维码Url"
|
||||
},
|
||||
{
|
||||
"prod_id": "240002",
|
||||
"prod_name": "月卡会员",
|
||||
"unit_price": 3000,
|
||||
"mark_price": 4900,
|
||||
"intro": "",
|
||||
"buy_url": "付款二维码Url"
|
||||
},
|
||||
{
|
||||
"prod_id": "240001",
|
||||
"prod_name": "年费会员",
|
||||
"unit_price": 9800,
|
||||
"mark_price": 36500,
|
||||
"intro": "",
|
||||
"buy_url": "付款二维码Url"
|
||||
}
|
||||
]
|
||||
},
|
||||
"errmsg": "ok",
|
||||
"errno": "00000",
|
||||
"host_time": "20250528102206"
|
||||
}
|
||||
```
|
||||
|
||||
## 六、查询付款状态
|
||||
|
||||
POST /vpapi/meb/product-buy-qry
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|prod_id| param |string| 是 | 240002 |
|
||||
|
||||
> 返回示例
|
||||
|
||||
未支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
已支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{
|
||||
"status":"paysuc"
|
||||
},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
|
||||
## 七、查询付款状态
|
||||
|
||||
POST /vpapi/meb/product-buy-qry
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|prod_id| param |string| 是 | 240002 |
|
||||
|
||||
> 返回示例
|
||||
|
||||
未支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
已支付
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{
|
||||
"status":"paysuc"
|
||||
},
|
||||
"errmsg":"没有查到订单",
|
||||
"errno":"ERROR",
|
||||
"host_time":"20250528102227"
|
||||
}
|
||||
```
|
||||
|
||||
八、退出
|
||||
|
||||
POST /vpapi/meb/logout
|
||||
|
||||
### 请求参数
|
||||
|
||||
|名称| 位置 |类型| 必选 | 值 |
|
||||
|---|--------|---|----|---------------------------------------------------------|
|
||||
|cookie| header |string| 是 | mss=3092447f3f26snCUIBpCShl3_kRxkaJsephz*************** |
|
||||
|
||||
> 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"body":{},
|
||||
"errmsg":"ok",
|
||||
"errno":"00000",
|
||||
"host_time":"20250528104040"
|
||||
}
|
||||
|
||||
```
|
||||
@ -28,7 +28,7 @@ public class MmsDocApiApplication {
|
||||
|
||||
ConfigurableApplicationContext applicationContext = SpringApplication.run(MmsDocApiApplication.class, args);
|
||||
Environment env = applicationContext.getEnvironment();
|
||||
System.out.println("移动端: 系统启动成功,当前环境为: " + env.getProperty("spring.profiles.active"));
|
||||
System.out.println("文档API端: 系统启动成功,当前环境为: " + env.getProperty("spring.profiles.active"));
|
||||
log.info("\n----------------------------------------------------------\n\t" +
|
||||
"Application '{}' is running! Access URLs:\n\t" +
|
||||
"Local: \t\thttp://localhost:{}\n\t" +
|
||||
|
||||
@ -1,262 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.exception.MmsException;
|
||||
|
||||
import com.sxpcwlkj.common.utils.IPUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
|
||||
|
||||
import com.sxpcwlkj.mobile.entity.StoreToolArea;
|
||||
import com.sxpcwlkj.mobile.entity.bo.SmsBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberVo;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreToolAreaMapper;
|
||||
import com.sxpcwlkj.mobile.service.StoreMemberService;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.sms.service.SmsService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.FileStorageService;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础接口
|
||||
*
|
||||
* @author xiaoyu(Myth)
|
||||
* @date 2020/10/23 14:45
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("api/v1/common")
|
||||
public class ApiCommonController extends BaseController {
|
||||
|
||||
private final FileStorageService fileStorageService;
|
||||
private final StoreMemberService apiMemberService;
|
||||
private final Environment environment;
|
||||
private final StoreToolAreaMapper storeToolAreaMapper;
|
||||
private final SmsService smsService;
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param type 类型 1:注册 2:登录 3:修改密码 4:支付密码 5:更换手机号
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/smsCode")
|
||||
public R<Void> smsCode(@RequestBody SmsBo bo, HttpServletRequest request) {
|
||||
|
||||
Integer type = bo.getType();
|
||||
|
||||
String phone = bo.getPhone();
|
||||
|
||||
String keytype = "_register_";
|
||||
if (type == 1) {
|
||||
keytype = "_register_";
|
||||
}
|
||||
if (type == 2) {
|
||||
keytype = "_login_";
|
||||
}
|
||||
if (type == 3) {
|
||||
keytype = "_password_";
|
||||
}
|
||||
if (type == 4) {
|
||||
keytype = "_passwordPay_";
|
||||
}
|
||||
if (type == 5) {
|
||||
keytype = "_updatePhone_";
|
||||
}
|
||||
if (environment.getProperty("spring.profiles.active").equals("prod")) {
|
||||
try {
|
||||
String ip = null;
|
||||
ip = IPUtil.getIp(request);
|
||||
log.info("ips:" + ip);
|
||||
Object s = RedisUtil.getCacheObject("ip:" + ip);
|
||||
int num = Convert.toInt(s == null ? 0 : Convert.toInt(s), 0);
|
||||
if (num >= 5) {
|
||||
log.info("ips>=5,拦截:" + ip);
|
||||
return R.fail("当前IP发送频繁,请一天后再发送哦!");
|
||||
}
|
||||
num++;
|
||||
RedisUtil.setCacheObject("ip:" + ip, num);
|
||||
RedisUtil.setCacheObject("ip:" + ip, num, Duration.ofDays(1));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
StoreMemberVo storeMemberVos = apiMemberService.selectVoByPhone(phone);
|
||||
if (type == 1) {
|
||||
if (storeMemberVos != null) {
|
||||
return R.fail("该手机号已注册!");
|
||||
}
|
||||
}
|
||||
if (type == 2 || type == 3) {
|
||||
|
||||
if (storeMemberVos == null) {
|
||||
return R.fail("该手机号账号不存在!");
|
||||
}
|
||||
if (storeMemberVos.getStatus() != 1) {
|
||||
throw new MmsException("会员状态不正常!");
|
||||
}
|
||||
}
|
||||
|
||||
String key = RedisUtil.CAPTCHA_CODE_KEY + keytype + phone;
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object != null) {
|
||||
RedisUtil.deleteObject(key);
|
||||
return R.fail("发送频繁,请稍后再发送哦!");
|
||||
}
|
||||
|
||||
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
||||
String code = RandomUtil.randomNumbers(6);
|
||||
Boolean sendSms = smsService.sendSms(phone,"SMS_465397663", code);
|
||||
RedisUtil.setCacheObject(key, code);
|
||||
RedisUtil.expire(key, Duration.ofMinutes(1));
|
||||
return R.success("手机短信码已发送!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* 成功返回文件 url
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/uploadFile")
|
||||
public R<String> uploadFile(MultipartFile file) {
|
||||
FileInfo fileInfo = fileStorageService.of(file)
|
||||
.setPath("upload/") //保存到相对路径下,为了方便管理,不需要可以不写
|
||||
.setObjectId("0") //关联对象id,为了方便管理,不需要可以不写
|
||||
.setObjectType("0") //关联对象类型,为了方便管理,不需要可以不写
|
||||
.putAttr("role", "admin") //保存一些属性,可以在切面、保存上传记录、自定义存储平台等地方获取使用,不需要可以不写
|
||||
.upload(); //将文件上传到对应地方
|
||||
return fileInfo == null ? R.fail("上传失败") : R.success("上传成功", fileInfo.getUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
* @param provincialName 不传 默认排序第一个省
|
||||
* @param cityName 不传 默认排序第一个市
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/storeToolAreaList")
|
||||
public R<List<Object>> storeToolAreaList(String provincialName, String cityName) {
|
||||
|
||||
List<StoreToolArea> areasOne = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, "0").orderByAsc(StoreToolArea::getSort));
|
||||
String[] array = areasOne.stream().map(StoreToolArea::getName).toArray(String[]::new);
|
||||
|
||||
|
||||
List<StoreToolArea> areasTwo = new ArrayList<>();
|
||||
List<StoreToolArea> areasThree = new ArrayList<>();
|
||||
|
||||
if (areasOne.size() > 0) {
|
||||
//获取第一个
|
||||
String provincialCode = areasOne.get(0).getCode();
|
||||
// 指定省
|
||||
if (StringUtil.isNotEmpty(provincialName)) {
|
||||
StoreToolArea areaClick = storeToolAreaMapper.selectOne(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, "0")
|
||||
.eq(StoreToolArea::getName, provincialName)
|
||||
.last("LIMIT 1"));
|
||||
if (areaClick != null) {
|
||||
provincialCode = areaClick.getCode();
|
||||
areasTwo = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, provincialCode).orderByAsc(StoreToolArea::getSort));
|
||||
if (areasTwo.size() > 0) {
|
||||
String cityCode = areasTwo.get(0).getCode();
|
||||
// 指定市
|
||||
if (StringUtil.isNotEmpty(cityName)) {
|
||||
StoreToolArea area = storeToolAreaMapper.selectOne(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, provincialCode)
|
||||
.eq(StoreToolArea::getName, cityName)
|
||||
.last("LIMIT 1"));
|
||||
if (area != null) {
|
||||
cityCode = area.getCode();
|
||||
}
|
||||
}
|
||||
areasThree = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, cityCode).orderByAsc(StoreToolArea::getSort));
|
||||
|
||||
}
|
||||
}else{
|
||||
areasTwo = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, provincialCode).orderByAsc(StoreToolArea::getSort));
|
||||
if (areasTwo.size() > 0) {
|
||||
String cityCode = areasTwo.get(0).getCode();
|
||||
// 指定市
|
||||
if (StringUtil.isNotEmpty(cityName)) {
|
||||
StoreToolArea area = storeToolAreaMapper.selectOne(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, provincialCode)
|
||||
.eq(StoreToolArea::getName, cityName)
|
||||
.last("LIMIT 1"));
|
||||
if (area != null) {
|
||||
cityCode = area.getCode();
|
||||
}
|
||||
}
|
||||
areasThree = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, cityCode).orderByAsc(StoreToolArea::getSort));
|
||||
}
|
||||
}
|
||||
}else {
|
||||
areasTwo = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, provincialCode).orderByAsc(StoreToolArea::getSort));
|
||||
if (areasTwo.size() > 0) {
|
||||
String cityCode = areasTwo.get(0).getCode();
|
||||
// 指定市
|
||||
if (StringUtil.isNotEmpty(cityName)) {
|
||||
StoreToolArea area = storeToolAreaMapper.selectOne(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, provincialCode)
|
||||
.eq(StoreToolArea::getName, cityName)
|
||||
.last("LIMIT 1"));
|
||||
if (area != null) {
|
||||
cityCode = area.getCode();
|
||||
}
|
||||
}
|
||||
areasThree = storeToolAreaMapper.selectList(new LambdaQueryWrapper<StoreToolArea>()
|
||||
.eq(StoreToolArea::getParentCode, cityCode).orderByAsc(StoreToolArea::getSort));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
List<Object> list = new ArrayList<>();
|
||||
|
||||
String[] arrayTwo = areasTwo.stream().map(StoreToolArea::getName).toArray(String[]::new);
|
||||
String[] arrayThree = areasThree.stream().map(StoreToolArea::getName).toArray(String[]::new);
|
||||
|
||||
list.add(array);
|
||||
list.add(arrayTwo);
|
||||
list.add(arrayThree);
|
||||
|
||||
return R.success("获取成功", list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,319 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.controller;
|
||||
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.enums.DeviceEnum;
|
||||
import com.sxpcwlkj.common.enums.HttpStatusEnum;
|
||||
import com.sxpcwlkj.common.exception.MmsException;
|
||||
|
||||
import com.sxpcwlkj.common.utils.IPUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberLoginBo;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberRegisterBo;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberVo;
|
||||
import com.sxpcwlkj.mobile.enums.DefStaticEnum;
|
||||
import com.sxpcwlkj.mobile.service.StoreMemberService;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.sxpcwlkj.redis.constant.RedisConstant;
|
||||
import com.sxpcwlkj.wx.service.WxService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
/**
|
||||
* 会员登录
|
||||
* 登录注册等一些基础功能
|
||||
*
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("api/v1/login")
|
||||
public class ApiLoginController extends BaseController {
|
||||
|
||||
private final StoreMemberService apiMemberService;
|
||||
private final WxService wxService;
|
||||
|
||||
|
||||
/**
|
||||
* 【公共部分】获取登录对象信息
|
||||
* @param request 请求
|
||||
* @param vo 会员信息
|
||||
* @return 会员信息
|
||||
*/
|
||||
@NotNull
|
||||
private R<StoreMemberVo> getLoginMemberInfo(HttpServletRequest request, StoreMemberVo vo) {
|
||||
if(vo==null){
|
||||
return R.fail("登录失败!");
|
||||
}
|
||||
String token = LoginObject.loginToken(vo.getId(), DeviceEnum.MOBILE.getType(), 10000000L, "id", vo.getId());
|
||||
vo.setToken(token);
|
||||
String ip = IPUtil.getIp(request);
|
||||
apiMemberService.update(new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId, vo.getId()).set(StoreMember::getLastLoginIp, ip));
|
||||
RedisUtil.setCacheObject(RedisConstant.MOBILE_KEY+vo.getId(),vo, Duration.ofHours(24));
|
||||
return R.response(Boolean.TRUE, vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* token自动登录
|
||||
* token传递在header
|
||||
*
|
||||
* @return 会员信息
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/tokenLogin")
|
||||
public R<StoreMemberVo> tokenLogin(HttpServletRequest request) {
|
||||
if (LoginObject.isLogin()) {
|
||||
StoreMemberVo vo = apiMemberService.selectVoById(LoginObject.getLoginId());
|
||||
return getLoginMemberInfo(request, vo);
|
||||
}
|
||||
throw new MmsException("请先登录!", HttpStatusEnum.FORBIDDEN.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信根据code,获取code进行静默登录
|
||||
* token传递在header
|
||||
* @param code 微信获取的code
|
||||
* @return 会员信息
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/codeGetOpenIdLogin")
|
||||
public R<StoreMemberVo> codeGetOpenIdLogin(@RequestParam("code")String code, HttpServletRequest request) {
|
||||
// 调用微信 API 获取用户的 openid 和 session_key
|
||||
WxMaJscode2SessionResult session = null;
|
||||
try {
|
||||
session = wxService.getWxMaService().getUserService().getSessionInfo(code);
|
||||
} catch (WxErrorException e) {
|
||||
throw new MmsException("微信登录失败!");
|
||||
}
|
||||
if (session==null) {
|
||||
throw new MmsException("获取微信登录信息为空!");
|
||||
}
|
||||
StoreMemberVo vo = apiMemberService.selectVoByOpenId(session.getOpenid());
|
||||
return getLoginMemberInfo(request, vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信注册/登录
|
||||
*
|
||||
* @param code 微信获取的code
|
||||
* @param encryptedData 微信获取的加密数据
|
||||
* @param iv 微信获取的iv
|
||||
* @return 会员信息
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/codeGetPhoneRegisterOrLogin")
|
||||
public R<StoreMemberVo> codeGetPhoneRegisterOrLogin(@RequestParam("code") String code, @RequestParam("encryptedData") String encryptedData, @RequestParam("iv") String iv, HttpServletRequest request) throws WxErrorException {
|
||||
// 调用微信 API 获取用户的 openid 和 session_key
|
||||
WxMaJscode2SessionResult session = wxService.getWxMaService().getUserService().getSessionInfo(code);
|
||||
String openid = session.getOpenid();
|
||||
// 调用微信 API 获取用户的手机号
|
||||
WxMaPhoneNumberInfo phoneInfo = wxService.getWxMaService().getUserService().getPhoneNoInfo(session.getSessionKey(), encryptedData, iv);
|
||||
String phoneNumber = phoneInfo.getPhoneNumber();
|
||||
if (StringUtil.isEmpty(phoneNumber)) {
|
||||
return R.fail("获取手机号失败!");
|
||||
}
|
||||
StoreMemberVo vo = apiMemberService.selectVoByPhone(phoneNumber);
|
||||
if (vo==null) {
|
||||
StoreMemberBo storeMemberBo = new StoreMemberBo();
|
||||
storeMemberBo.setAccount(phoneNumber);
|
||||
storeMemberBo.setPhone(phoneNumber);
|
||||
storeMemberBo.setNickname("");
|
||||
storeMemberBo.setHeadPortrait(DefStaticEnum.MEMBER_DEF_HEADER_IMG.getValue());
|
||||
storeMemberBo.setPassword(SecureUtil.md5(phoneNumber));
|
||||
storeMemberBo.setSex(3);
|
||||
storeMemberBo.setStatus(1);
|
||||
storeMemberBo.setReputationScore(100);
|
||||
storeMemberBo.setLevel(1);
|
||||
storeMemberBo.setInvitationCode("");
|
||||
storeMemberBo.setWxOpenid(openid);
|
||||
apiMemberService.insert(storeMemberBo);
|
||||
vo = apiMemberService.selectVoByPhone(phoneNumber);
|
||||
}
|
||||
if (vo.getWxOpenid()==null|| vo.getWxOpenid().isEmpty()) {
|
||||
apiMemberService.update(new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId, vo.getId()).set(StoreMember::getWxOpenid, openid));
|
||||
}
|
||||
return getLoginMemberInfo(request, vo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 账号会员注册
|
||||
*
|
||||
* @param bo bo
|
||||
* @return 会员信息
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/accountRegister")
|
||||
public R<StoreMemberVo> accountRegister(@RequestBody StoreMemberRegisterBo bo, HttpServletRequest request) {
|
||||
|
||||
if (StringUtil.isEmpty(bo.getPhone())) {
|
||||
return R.fail("请输入手机号!");
|
||||
}
|
||||
if (StringUtil.isEmpty(bo.getSmsCode())) {
|
||||
return R.fail("请输入短信验证码!");
|
||||
}
|
||||
if (StringUtil.isEmpty(bo.getPassword())) {
|
||||
return R.fail("请输入密码!");
|
||||
}
|
||||
if (bo.getPassword().length() < 6 || bo.getPassword().length() > 16) {
|
||||
return R.fail("密码长度应该在6~16位之间!");
|
||||
}
|
||||
StoreMemberVo storeMemberVo = apiMemberService.selectVoByPhone(bo.getPhone());
|
||||
if (StringUtil.isNotEmpty(storeMemberVo)) {
|
||||
return R.fail("该手机号已注册!");
|
||||
}
|
||||
|
||||
String key = RedisUtil.CAPTCHA_CODE_KEY + "_register_" + bo.getPhone();
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object == null) {
|
||||
return R.fail("短信验证码失效!");
|
||||
} else {
|
||||
if (!bo.getSmsCode().equals(object.toString())) {
|
||||
return R.fail("短信验证码有误!");
|
||||
}
|
||||
}
|
||||
StoreMemberBo storeMemberBo = new StoreMemberBo();
|
||||
storeMemberBo.setAccount(bo.getPhone());
|
||||
storeMemberBo.setPhone(bo.getPhone());
|
||||
storeMemberBo.setNickname("");
|
||||
storeMemberBo.setHeadPortrait(DefStaticEnum.MEMBER_DEF_HEADER_IMG.getValue());
|
||||
storeMemberBo.setPassword(SecureUtil.md5(bo.getPassword()));
|
||||
storeMemberBo.setSex(3);
|
||||
storeMemberBo.setStatus(1);
|
||||
storeMemberBo.setReputationScore(100);
|
||||
storeMemberBo.setLevel(1);
|
||||
storeMemberBo.setInvitationCode(bo.getInvitationCode());
|
||||
Boolean aBoolean = apiMemberService.insert(storeMemberBo);
|
||||
if (aBoolean) {
|
||||
StoreMemberVo vo = apiMemberService.selectVoByPhone(storeMemberBo.getPhone());
|
||||
return getLoginMemberInfo(request, vo);
|
||||
}
|
||||
return R.fail("注册失败!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号密码登录
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/accountLogin")
|
||||
public R<StoreMemberVo> accountLogin(@RequestBody @Validated StoreMemberLoginBo bo, HttpServletRequest request) {
|
||||
log.info(SecureUtil.md5(bo.getPassword()));
|
||||
StoreMemberVo storeMemberVo = apiMemberService.selectVoByAccount(bo.getPhone());
|
||||
if (storeMemberVo == null) {
|
||||
return R.fail("账号不存在!");
|
||||
}
|
||||
if (storeMemberVo.getPassword().equals(SecureUtil.md5(bo.getPassword()))) {
|
||||
return getLoginMemberInfo(request, storeMemberVo);
|
||||
}
|
||||
return R.fail("登录密码错误!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号登录
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/login")
|
||||
public R<StoreMemberVo> login(@RequestBody StoreMemberLoginBo bo, HttpServletRequest request) {
|
||||
|
||||
if (StringUtil.isEmpty(bo.getPhone())) {
|
||||
return R.fail("请输入手机号!");
|
||||
}
|
||||
if (StringUtil.isEmpty(bo.getSmsCode())) {
|
||||
return R.fail("请输入短信验证码!");
|
||||
}
|
||||
StoreMemberVo storeMemberVo = apiMemberService.selectVoByPhone(bo.getPhone());
|
||||
if (storeMemberVo==null) {
|
||||
return R.fail("账号不存在!");
|
||||
}
|
||||
String key = RedisUtil.CAPTCHA_CODE_KEY + "_login_" + bo.getPhone();
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object == null) {
|
||||
return R.fail("短信验证码失效!");
|
||||
} else {
|
||||
if (!bo.getSmsCode().equals(object.toString())) {
|
||||
return R.fail("短信验证码有误!");
|
||||
}
|
||||
}
|
||||
return getLoginMemberInfo(request, storeMemberVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 找回密码
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/findPassword")
|
||||
public R<StoreMemberVo> findPassword(@RequestBody StoreMemberLoginBo bo, HttpServletRequest request) {
|
||||
|
||||
if (StringUtil.isEmpty(bo.getPhone())) {
|
||||
return R.fail("请输入手机号!");
|
||||
}
|
||||
if (StringUtil.isEmpty(bo.getSmsCode())) {
|
||||
return R.fail("请输入短信验证码!");
|
||||
}
|
||||
if (StringUtil.isEmpty(bo.getPassword())) {
|
||||
return R.fail("请输入密码!");
|
||||
}
|
||||
if (bo.getPassword().length() < 6 || bo.getPassword().length() > 16) {
|
||||
return R.fail("密码长度应该在6~16位之间!");
|
||||
}
|
||||
StoreMemberVo storeMemberVo = apiMemberService.selectVoByPhone(bo.getPhone());
|
||||
if (storeMemberVo==null) {
|
||||
return R.fail("账号不存在!");
|
||||
}
|
||||
String key = RedisUtil.CAPTCHA_CODE_KEY + "_password_" + bo.getPhone();
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object == null) {
|
||||
return R.fail("短信验证码失效!");
|
||||
} else {
|
||||
if (!bo.getSmsCode().equals(object.toString())) {
|
||||
return R.fail("短信验证码有误!");
|
||||
}
|
||||
}
|
||||
apiMemberService.update(new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getPhone, bo.getPhone()).set(StoreMember::getPassword, SecureUtil.md5(bo.getPassword())));
|
||||
return getLoginMemberInfo(request, storeMemberVo);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/logout")
|
||||
public R<Void> logout() {
|
||||
LoginObject.logout();
|
||||
return R.success("退出成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertisingLocation;
|
||||
import com.sxpcwlkj.mobile.entity.bo.AdvertisingBo;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreAdvertisingBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingLocationVo;
|
||||
import com.sxpcwlkj.mobile.service.StoreAdvertisingLocationService;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 广告列表
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("api/v1/location")
|
||||
public class ApiStoreAdvertisingController extends BaseController{
|
||||
|
||||
private final StoreAdvertisingLocationService storeAdvertisingLocationService;
|
||||
|
||||
|
||||
/**
|
||||
* 所有广告位列表
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/locationList")
|
||||
public R<List<StoreAdvertisingLocationVo>> locationList(){
|
||||
StoreAdvertisingBo bo = new StoreAdvertisingBo();
|
||||
bo.setStatus(1);
|
||||
List<StoreAdvertisingLocationVo> list= storeAdvertisingLocationService.selectVoList(new LambdaQueryWrapper<StoreAdvertisingLocation>()
|
||||
.eq(StoreAdvertisingLocation::getStatus,1).orderByDesc(StoreAdvertisingLocation::getSort));
|
||||
return R.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 某个广告位下广告
|
||||
* @param bo 广告位编码【code】
|
||||
* @return
|
||||
*/
|
||||
@SaIgnore
|
||||
@PostMapping("/locationListById")
|
||||
public R<StoreAdvertisingLocationVo> locationListById(@Validated @RequestBody AdvertisingBo bo){
|
||||
|
||||
return R.success(storeAdvertisingLocationService.selectVoListByCode(bo.getCode()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,146 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAddress;
|
||||
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberAddressBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberAddressVo;
|
||||
import com.sxpcwlkj.mobile.service.StoreMemberAddressService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 会员收件地址
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("api/v1/member/address")
|
||||
public class ApiStoreMemberAddressController extends BaseController{
|
||||
private final StoreMemberAddressService baseService;
|
||||
|
||||
/**
|
||||
* 地址列表-分页查询
|
||||
*
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/list")
|
||||
public R<TableDataInfo<StoreMemberAddressVo>> listPage(PageQuery pageQuery){
|
||||
StoreMemberAddressBo bo=new StoreMemberAddressBo();
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
bo.setMemberId(storeMember.getId());
|
||||
return R.success(baseService.selectListVoPage(bo, pageQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址详情
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/{id}")
|
||||
public R<StoreMemberAddressVo> queryById(@PathVariable String id) {
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
return success(baseService.selectVoByIdAndMid(id, storeMember.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址编辑
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/edit")
|
||||
public R<Boolean> edit(@Validated @RequestBody(required = false) StoreMemberAddressBo bo) {
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
bo.setMemberId(storeMember.getId());
|
||||
// 如果是默认地址,则将之前的默认地址设为非默认
|
||||
if(bo.getTolerant().equals("1")){
|
||||
baseService.update(new LambdaUpdateWrapper<StoreMemberAddress>()
|
||||
.eq(StoreMemberAddress::getMemberId,bo.getMemberId())
|
||||
.set(StoreMemberAddress::getTolerant,0));
|
||||
}
|
||||
return success(baseService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址设为默认
|
||||
*
|
||||
* @param id 地址ID
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/updateDef")
|
||||
public R<Boolean> updateDef( String id) {
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
StoreMemberAddressVo storeMemberAddressVo = baseService.selectVoByIdAndMid(id, storeMember.getId());
|
||||
if(storeMemberAddressVo!=null){
|
||||
|
||||
baseService.update(new LambdaUpdateWrapper<StoreMemberAddress>()
|
||||
.eq(StoreMemberAddress::getMemberId, storeMember.getId())
|
||||
.set(StoreMemberAddress::getTolerant,0));
|
||||
|
||||
baseService.update(new LambdaUpdateWrapper<StoreMemberAddress>()
|
||||
.eq(StoreMemberAddress::getId,id)
|
||||
.set(StoreMemberAddress::getTolerant,1));
|
||||
return success(true);
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址新增
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@PostMapping("/insert")
|
||||
public R<Boolean> insert(@Validated @RequestBody(required = false) StoreMemberAddressBo bo) {
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
bo.setMemberId(storeMember.getId());
|
||||
bo.setStatus(0);
|
||||
bo.setId(null);
|
||||
bo.setMemberId(storeMember.getId());
|
||||
// 如果是默认地址,则将之前的默认地址设为非默认
|
||||
if(bo.getTolerant().equals("1")){
|
||||
baseService.update(new LambdaUpdateWrapper<StoreMemberAddress>()
|
||||
.eq(StoreMemberAddress::getMemberId,bo.getMemberId())
|
||||
.set(StoreMemberAddress::getTolerant,0));
|
||||
}
|
||||
return success(baseService.insert(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 地址删除
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/delete/{id}")
|
||||
public R<Boolean> delete(@PathVariable String id) {
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
return success(baseService.deleteByIdAndMid(id, storeMember.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,139 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.code.controller.BaseController;
|
||||
import com.sxpcwlkj.common.utils.BeanCopyUtil;
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberUpdateBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberVo;
|
||||
import com.sxpcwlkj.mobile.service.StoreMemberService;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import com.xkzhangsan.time.utils.StringUtil;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员中心
|
||||
* @author sxpcwlkj
|
||||
* @date 2020/11/17
|
||||
* @description
|
||||
*/
|
||||
|
||||
@SuppressWarnings("all")
|
||||
@Slf4j
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("api/v1/member")
|
||||
public class ApiStoreMemberController extends BaseController {
|
||||
|
||||
private final StoreMemberService apiMemberService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
* 已登录用户自动获取
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/info")
|
||||
public R<StoreMemberVo> getMemberInfo() {
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
StoreMemberVo vo = BeanCopyUtil.convert(storeMember, StoreMemberVo.class);
|
||||
return R.success("获取成功",vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新会员信息
|
||||
* @param type 1:手机号 2:密码 3:昵称 4:头像 5:性别 6:账号 7:生日
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@SuppressWarnings("unchecked")
|
||||
@PostMapping("/updateMember")
|
||||
public R<String> updateMember(@RequestBody StoreMemberUpdateBo bo) {
|
||||
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
bo.setMemberId(storeMember.getId());
|
||||
//更换手机号
|
||||
if (bo.getType() == 1) {
|
||||
if (StringUtil.isEmpty(bo.getPhone())) {
|
||||
return R.fail("请输入手机号!");
|
||||
}
|
||||
if (StringUtils.isEmpty(bo.getSmsCode())) {
|
||||
return R.fail("请输入验证码!");
|
||||
}
|
||||
StoreMemberVo storeMemberVo = apiMemberService.selectVoByPhone(bo.getPhone());
|
||||
if (storeMemberVo!=null) {
|
||||
return R.fail("该手机号已被占用!");
|
||||
}
|
||||
String key = RedisUtil.CAPTCHA_CODE_KEY + "_updatePhone_" + bo.getPhone();
|
||||
Object object = RedisUtil.getCacheObject(key);
|
||||
if (object == null) {
|
||||
return R.fail("短信验证码失效!");
|
||||
} else {
|
||||
if (!bo.getSmsCode().equals(object.toString())) {
|
||||
return R.fail("短信验证码有误!");
|
||||
}
|
||||
}
|
||||
|
||||
} else if (bo.getType() == 2) {
|
||||
if (StringUtils.isEmpty(bo.getPassword())) {
|
||||
return R.fail("请输入密码!");
|
||||
}
|
||||
if (bo.getPassword().length() < 6||bo.getPassword().length() >16) {
|
||||
return R.fail("密码长度应该在6~16位之间!");
|
||||
}
|
||||
bo.setPassword(SecureUtil.md5(bo.getPassword()));
|
||||
} else if (bo.getType() == 3) {
|
||||
if (StringUtils.isEmpty(bo.getNickname())) {
|
||||
return R.fail("请传入昵称!");
|
||||
}
|
||||
} else if (bo.getType() == 4) {
|
||||
if (StringUtils.isEmpty(bo.getHeadPortrait())) {
|
||||
return R.fail("请传入头像地址!");
|
||||
}
|
||||
}else if (bo.getType() == 5) {
|
||||
if (!(bo.getSex()==1||bo.getSex()==2||bo.getSex()==3)) {
|
||||
return R.fail("请传入正确的性别!");
|
||||
}
|
||||
}else if (bo.getType() == 6) {
|
||||
if (StringUtils.isEmpty(bo.getAccount())) {
|
||||
return R.fail("请传入账号!");
|
||||
}
|
||||
StoreMemberVo storeMemberVo = apiMemberService.selectVoByAccount(bo.getAccount());
|
||||
if (storeMemberVo!=null) {
|
||||
return R.fail("该账号已被占用!");
|
||||
}
|
||||
}else if (bo.getType() == 7) {
|
||||
if (bo.getBirthday()==null) {
|
||||
return R.fail("请传入生日(yyyy-MM-dd)!");
|
||||
}
|
||||
}
|
||||
return apiMemberService.updateMember(bo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
* @param a 身份证正面网络地址
|
||||
* @param b 身份证反面网络地址
|
||||
* @return
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/authentication")
|
||||
public R<Map<String, String>> authentication(@Validated @NotNull(message = "身份证正面不能为空") String one,@Validated @NotNull(message = "身份证背面不能为空") String two) {
|
||||
return apiMemberService.authentication(one,two);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store")
|
||||
public class Store extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String storeId;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String storeName;
|
||||
/**
|
||||
* 店铺类型;1:企业 2:个人
|
||||
*/
|
||||
private Integer storeType;
|
||||
/**
|
||||
* 营业状态;0.禁用 1.营业 2.休业
|
||||
*/
|
||||
private Integer businessState;
|
||||
/**
|
||||
* 店铺地址
|
||||
*/
|
||||
private String storeAddress;
|
||||
/**
|
||||
* 店铺经度
|
||||
*/
|
||||
private String storeLongitude;
|
||||
/**
|
||||
* 店铺维度
|
||||
*/
|
||||
private String storeLatitude;
|
||||
/**
|
||||
* 店铺logo
|
||||
*/
|
||||
private String storeLogo;
|
||||
/**
|
||||
* 店铺门头
|
||||
*/
|
||||
private String storeBgImg;
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
private String storeIntroduction;
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
private String storeBusinessTime;
|
||||
/**
|
||||
* 店铺电话
|
||||
*/
|
||||
private String storePhone;
|
||||
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 广告;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store_advertising")
|
||||
public class StoreAdvertising extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 广告位ID
|
||||
*/
|
||||
private String advertisingId;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String routeUrl;
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String imageUrl;
|
||||
/**
|
||||
* 路由参数
|
||||
*/
|
||||
private String routeParameter;
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 广告位;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store_advertising_location")
|
||||
public class StoreAdvertisingLocation extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 广告位名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 广告位高度
|
||||
*/
|
||||
private String height;
|
||||
/**
|
||||
* 广告位宽度
|
||||
*/
|
||||
private String width;
|
||||
/**
|
||||
* 广告位编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 最大显示数量
|
||||
*/
|
||||
private String maxNum;
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 店铺会员;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-30
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store_member")
|
||||
public class StoreMember extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String headPortrait;
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthday;
|
||||
|
||||
/**
|
||||
* 信用分
|
||||
*/
|
||||
private Integer reputationScore;
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
private String payPassword;
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String privateKey;
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
private String wxOpenid;
|
||||
/**
|
||||
* 支付宝OPENID
|
||||
*/
|
||||
private String alipayOpenid;
|
||||
/**
|
||||
* 抖音OPENID
|
||||
*/
|
||||
private String douyinOpenid;
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String lastLoginIp;
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员收件地址;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store_member_address")
|
||||
public class StoreMemberAddress extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private String memberId;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件人手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 国家
|
||||
*/
|
||||
private String country;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区/县
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
@TableField(value = "is_def")
|
||||
private String tolerant;
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sxpcwlkj.common.annotation.SensitivityEncrypt;
|
||||
import com.sxpcwlkj.common.enums.SensitivityTypeEnum;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author mms
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store_member_authentication")
|
||||
public class StoreMemberAuthentication extends BaseEntity {
|
||||
|
||||
/** ID */
|
||||
@TableId
|
||||
private String id ;
|
||||
/** 会员ID */
|
||||
private String memberId ;
|
||||
/** 姓名 */
|
||||
@SensitivityEncrypt(type = SensitivityTypeEnum.NAME)
|
||||
private String name ;
|
||||
/** 身份证号 */
|
||||
@SensitivityEncrypt(type = SensitivityTypeEnum.ID_CARD)
|
||||
private String number ;
|
||||
/** 手机号 */
|
||||
private String phone ;
|
||||
/** 身份证正面 */
|
||||
private String imageFront ;
|
||||
/** 身份证背面 */
|
||||
private String imageBack ;
|
||||
private String sex;
|
||||
private String address;
|
||||
private String nationality;
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员分销
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-02-01
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@TableName("store_member_distribution")
|
||||
public class StoreMemberDistribution extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private String memberId;
|
||||
/**
|
||||
* 上级ID
|
||||
*/
|
||||
private String fatherIdOne;
|
||||
/**
|
||||
* 上上级ID
|
||||
*/
|
||||
private String fatherIdTwo;
|
||||
/**
|
||||
* 上上上级ID
|
||||
*/
|
||||
private String fatherIdThree;
|
||||
/**
|
||||
* 推荐注册人ID
|
||||
*/
|
||||
private String referrerId;
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author shanpengnian
|
||||
*/
|
||||
@Data
|
||||
public class StoreToolArea {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* /编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 父编码
|
||||
*/
|
||||
private String parentCode;
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
|
||||
@Data
|
||||
public class AdvertisingBo {
|
||||
@NotEmpty(message = "name不能为空")
|
||||
@NotNull(message = "desc不能为空")
|
||||
private String code;
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class SmsBo {
|
||||
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
private String phone;
|
||||
/**
|
||||
* 1:注册 2:登录 3:修改密码 4:支付密码 5:更换手机号
|
||||
*/
|
||||
@NotBlank(message = "类型不能为空")
|
||||
private Integer type;
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertising;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 广告;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreAdvertising.class)
|
||||
public class StoreAdvertisingBo extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 广告位ID
|
||||
*/
|
||||
private String advertisingLocationId;
|
||||
/**
|
||||
* 广告名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 广告图
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 是否跳转
|
||||
*/
|
||||
private Integer isOpen;
|
||||
/**
|
||||
* 打开方式
|
||||
*/
|
||||
private Integer openWay;
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String openPath;
|
||||
/**
|
||||
* 路由参数
|
||||
*/
|
||||
private String routeParameter;
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertisingLocation;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 广告位;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreAdvertisingLocation.class)
|
||||
public class StoreAdvertisingLocationBo extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 广告位名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 广告位编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private Integer width;
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private Integer height;
|
||||
/**
|
||||
* 最大显示数量
|
||||
*/
|
||||
private Integer maxNum;
|
||||
}
|
||||
@ -1,122 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.Store;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = Store.class)
|
||||
public class StoreBo extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String storeId;
|
||||
/**
|
||||
* 店铺类型
|
||||
*/
|
||||
private String storeTypeId;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String storeName;
|
||||
/**
|
||||
* 店铺类型;1:企业 2:个人
|
||||
*/
|
||||
private Integer storeType;
|
||||
/**
|
||||
* 营业状态;0.禁用 1.营业 2.休业
|
||||
*/
|
||||
private Integer businessState;
|
||||
/**
|
||||
* 店铺地址
|
||||
*/
|
||||
private String storeAddress;
|
||||
/**
|
||||
* 店铺经度
|
||||
*/
|
||||
private String storeLongitude;
|
||||
/**
|
||||
* 店铺维度
|
||||
*/
|
||||
private String storeLatitude;
|
||||
/**
|
||||
* 店铺logo
|
||||
*/
|
||||
private String storeLogo;
|
||||
/**
|
||||
* 店铺门头
|
||||
*/
|
||||
private String storeBgImg;
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
private String storeIntroduction;
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
private String storeBusinessTime;
|
||||
/**
|
||||
* 店铺电话
|
||||
*/
|
||||
private String storePhone;
|
||||
/**
|
||||
* 服务社区
|
||||
*/
|
||||
private String storeCommunity;
|
||||
/**
|
||||
* 社区描述
|
||||
*/
|
||||
private String storeCommunityMark;
|
||||
/**
|
||||
* 月销售额
|
||||
*/
|
||||
private BigDecimal monthlySales;
|
||||
/**
|
||||
* 配送费用
|
||||
*/
|
||||
private BigDecimal distributionPrice;
|
||||
/**
|
||||
* 店铺星级
|
||||
*/
|
||||
private String storeRank;
|
||||
/**
|
||||
* 店铺评分
|
||||
*/
|
||||
private String storeScore;
|
||||
/**
|
||||
* 起送订单金额
|
||||
*/
|
||||
private BigDecimal startingPrice;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer storeAuditState;
|
||||
/**
|
||||
* 审核原因
|
||||
*/
|
||||
private String storeAuditWhy;
|
||||
/**
|
||||
* 店铺备用装修图片1
|
||||
*/
|
||||
private String storeImgOne;
|
||||
/**
|
||||
* 店铺备用装修图片2
|
||||
*/
|
||||
private String storeImgTwo;
|
||||
/**
|
||||
* 店铺备用装修图片3
|
||||
*/
|
||||
private String storeImgThree;
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAddress;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 会员收件地址;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreMemberAddress.class)
|
||||
public class StoreMemberAddressBo extends BaseEntity{
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 会员ID 可不传后台自动获取
|
||||
*/
|
||||
private String memberId;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件人手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 国家
|
||||
*/
|
||||
private String country;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区/县
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 是否默认 0否 1是
|
||||
*/
|
||||
private String tolerant;
|
||||
}
|
||||
@ -1,92 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 店铺会员;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-30
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreMember.class)
|
||||
public class StoreMemberBo extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String headPortrait;
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthday;
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
private String wxOpenid;
|
||||
/**
|
||||
* 信用分
|
||||
*/
|
||||
private Integer reputationScore;
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
private String payPassword;
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String privateKey;
|
||||
/**
|
||||
* 支付宝OPENID
|
||||
*/
|
||||
private String alipayOpenid;
|
||||
/**
|
||||
* 抖音OPENID
|
||||
*/
|
||||
private String douyinOpenid;
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String lastLoginIp;
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberDistribution;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
/**
|
||||
* 会员分销
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-02-01
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreMemberDistribution.class)
|
||||
public class StoreMemberDistributionBo extends BaseEntity {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private String memberId;
|
||||
/**
|
||||
* 上级ID
|
||||
*/
|
||||
private String fatherIdOne;
|
||||
/**
|
||||
* 上上级ID
|
||||
*/
|
||||
private String fatherIdTwo;
|
||||
/**
|
||||
* 上上上级ID
|
||||
*/
|
||||
private String fatherIdThree;
|
||||
/**
|
||||
* 推荐注册人ID
|
||||
*/
|
||||
private String referrerId;
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 会员登录BO
|
||||
* @Description 会员登录
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class StoreMemberLoginBo {
|
||||
|
||||
/**
|
||||
* 会员账号
|
||||
*/
|
||||
//@Deprecated
|
||||
|
||||
private String account;
|
||||
/**
|
||||
* 会员手机号/账号
|
||||
*/
|
||||
@NotBlank(message = "会员手机号/账号不能为空")
|
||||
private String phone;
|
||||
/**
|
||||
* 短信验证码(手机号登录必填)
|
||||
*/
|
||||
private String smsCode;
|
||||
/**
|
||||
* 账号密码(账号登录必填)
|
||||
*/
|
||||
@NotBlank(message = "账号密码不能为空")
|
||||
private String password;
|
||||
/**
|
||||
* 注册邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 会员注册BO
|
||||
* @Description 会员注册
|
||||
* @Author sxpcwlkj
|
||||
* @Version v1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class StoreMemberRegisterBo {
|
||||
|
||||
/**
|
||||
* 会员账号
|
||||
*/
|
||||
@Deprecated
|
||||
private String account;
|
||||
/**
|
||||
* 会员手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@NotNull
|
||||
private String phone;
|
||||
/**
|
||||
* 短信验证码
|
||||
*/
|
||||
@NotBlank(message = "短信验证码不能为空")
|
||||
@NotNull
|
||||
private String smsCode;
|
||||
/**
|
||||
* 账号密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@NotNull
|
||||
private String password;
|
||||
/**
|
||||
* 注册邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class StoreMemberUpdateBo {
|
||||
|
||||
/**
|
||||
* 操作类型 1:手机号 2:密码 3:昵称 4:头像 5:性别 6:账号 7:生日
|
||||
*/
|
||||
@NotBlank
|
||||
@NotNull
|
||||
private Integer type;
|
||||
|
||||
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 昵称 type=3 必传
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 账号 type=6 必传
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 性别 type=5 必传
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 手机号 type=1 必传
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 密码 type=2 必传
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 头像 type=4 必传
|
||||
*/
|
||||
private String headPortrait;
|
||||
/**
|
||||
* 短信验证码 type=1 必传
|
||||
*/
|
||||
private String smsCode;
|
||||
/**
|
||||
* 生日 type=7 必传
|
||||
*/
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.vo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertisingLocation;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 广告位;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreAdvertisingLocation.class)
|
||||
public class StoreAdvertisingLocationVo{
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 广告位名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 广告位高度
|
||||
*/
|
||||
private String height;
|
||||
/**
|
||||
* 广告位宽度
|
||||
*/
|
||||
private String width;
|
||||
/**
|
||||
* 广告位编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 最大显示数量
|
||||
*/
|
||||
private String maxNum;
|
||||
|
||||
private List<StoreAdvertisingVo> storeAdvertisingList;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.vo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sxpcwlkj.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertising;
|
||||
import java.util.Date;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 广告;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreAdvertising.class)
|
||||
public class StoreAdvertisingVo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 广告位ID
|
||||
*/
|
||||
private String advertisingId;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 路由地址
|
||||
*/
|
||||
private String routeUrl;
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String imageUrl;
|
||||
/**
|
||||
* 路由参数
|
||||
*/
|
||||
private String routeParameter;
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAddress;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 会员收件地址;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreMemberAddress.class)
|
||||
public class StoreMemberAddressVo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private String memberId;
|
||||
/**
|
||||
* 收件人名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 收件人手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 国家
|
||||
*/
|
||||
private String country;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区/县
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
private String tolerant;
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberDistribution;
|
||||
|
||||
|
||||
/**
|
||||
* 会员分销
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-02-01
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreMemberDistribution.class)
|
||||
public class StoreMemberDistributionVo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 会员ID
|
||||
*/
|
||||
private String memberId;
|
||||
/**
|
||||
* 上级ID
|
||||
*/
|
||||
private String fatherIdOne;
|
||||
/**
|
||||
* 上上级ID
|
||||
*/
|
||||
private String fatherIdTwo;
|
||||
/**
|
||||
* 上上上级ID
|
||||
*/
|
||||
private String fatherIdThree;
|
||||
/**
|
||||
* 推荐注册人ID
|
||||
*/
|
||||
private String referrerId;
|
||||
}
|
||||
@ -1,110 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.vo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sxpcwlkj.common.annotation.SensitivityEncrypt;
|
||||
import com.sxpcwlkj.common.enums.SensitivityTypeEnum;
|
||||
import com.sxpcwlkj.datasource.entity.BaseEntity;
|
||||
|
||||
import com.sxpcwlkj.framework.entity.BaseEntityVo;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAuthentication;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺会员;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-30
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = StoreMember.class)
|
||||
public class StoreMemberVo extends BaseEntityVo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@SensitivityEncrypt(type = SensitivityTypeEnum.PHONE)
|
||||
private String phone;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String headPortrait;
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
private Date birthday;
|
||||
/**
|
||||
* 微信openid
|
||||
*/
|
||||
private String wxOpenid;
|
||||
/**
|
||||
* 信用分
|
||||
*/
|
||||
private Integer reputationScore;
|
||||
/**
|
||||
* 级别
|
||||
*/
|
||||
private Integer level;
|
||||
/**
|
||||
* 邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
/**
|
||||
* 支付密码
|
||||
*/
|
||||
private String payPassword;
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String privateKey;
|
||||
/**
|
||||
* 支付宝OPENID
|
||||
*/
|
||||
private String alipayOpenid;
|
||||
/**
|
||||
* 抖音OPENID
|
||||
*/
|
||||
private String douyinOpenid;
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String lastLoginIp;
|
||||
/**
|
||||
* 认证信息
|
||||
*/
|
||||
private StoreMemberAuthentication authentication;
|
||||
/**
|
||||
* Token
|
||||
*/
|
||||
private String token ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.entity.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import com.sxpcwlkj.mobile.entity.Store;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Data
|
||||
@AutoMapper(target = Store.class)
|
||||
public class StoreVo {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String storeId;
|
||||
/**
|
||||
* 店铺类型
|
||||
*/
|
||||
private String storeTypeId;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String storeName;
|
||||
/**
|
||||
* 店铺类型;1:企业 2:个人
|
||||
*/
|
||||
private Integer storeType;
|
||||
/**
|
||||
* 营业状态;0.禁用 1.营业 2.休业
|
||||
*/
|
||||
private Integer businessState;
|
||||
/**
|
||||
* 店铺地址
|
||||
*/
|
||||
private String storeAddress;
|
||||
/**
|
||||
* 店铺经度
|
||||
*/
|
||||
private String storeLongitude;
|
||||
/**
|
||||
* 店铺维度
|
||||
*/
|
||||
private String storeLatitude;
|
||||
/**
|
||||
* 店铺logo
|
||||
*/
|
||||
private String storeLogo;
|
||||
/**
|
||||
* 店铺门头
|
||||
*/
|
||||
private String storeBgImg;
|
||||
/**
|
||||
* 店铺简介
|
||||
*/
|
||||
private String storeIntroduction;
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
private String storeBusinessTime;
|
||||
/**
|
||||
* 店铺电话
|
||||
*/
|
||||
private String storePhone;
|
||||
/**
|
||||
* 服务社区
|
||||
*/
|
||||
private String storeCommunity;
|
||||
/**
|
||||
* 社区描述
|
||||
*/
|
||||
private String storeCommunityMark;
|
||||
/**
|
||||
* 月销售额
|
||||
*/
|
||||
private BigDecimal monthlySales;
|
||||
/**
|
||||
* 配送费用
|
||||
*/
|
||||
private BigDecimal distributionPrice;
|
||||
/**
|
||||
* 店铺星级
|
||||
*/
|
||||
private String storeRank;
|
||||
/**
|
||||
* 店铺评分
|
||||
*/
|
||||
private String storeScore;
|
||||
/**
|
||||
* 起送订单金额
|
||||
*/
|
||||
private BigDecimal startingPrice;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer storeAuditState;
|
||||
/**
|
||||
* 审核原因
|
||||
*/
|
||||
private String storeAuditWhy;
|
||||
/**
|
||||
* 店铺备用装修图片1
|
||||
*/
|
||||
private String storeImgOne;
|
||||
/**
|
||||
* 店铺备用装修图片2
|
||||
*/
|
||||
private String storeImgTwo;
|
||||
/**
|
||||
* 店铺备用装修图片3
|
||||
*/
|
||||
private String storeImgThree;
|
||||
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertisingLocation;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingLocationVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 广告位;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StoreAdvertisingLocationMapper extends BaseMapperPlus<StoreAdvertisingLocation, StoreAdvertisingLocationVo> {
|
||||
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertising;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 广告;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StoreAdvertisingMapper extends BaseMapperPlus<StoreAdvertising, StoreAdvertisingVo> {
|
||||
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.mobile.entity.Store;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-26
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StoreMapper extends BaseMapperPlus<Store, StoreVo> {
|
||||
|
||||
/**
|
||||
* 列表分页条件查询
|
||||
* @param page 分页构造
|
||||
* @param sql sql条件拼接
|
||||
* @return
|
||||
*/
|
||||
Page<StoreVo> listPageXml(@Param("page")Page<Object> page, @Param("sql")String sql);
|
||||
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAddress;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberAddressVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 会员收件地址;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StoreMemberAddressMapper extends BaseMapperPlus<StoreMemberAddress, StoreMemberAddressVo> {
|
||||
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAuthentication;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface StoreMemberAuthenticationMapper extends BaseMapper<StoreMemberAuthentication> {
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberDistribution;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberDistributionVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 会员分销
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-02-01
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StoreMemberDistributionMapper extends BaseMapperPlus<StoreMemberDistribution, StoreMemberDistributionVo> {
|
||||
|
||||
/**
|
||||
* 列表分页条件查询
|
||||
* @param page 分页构造
|
||||
* @param sql sql条件拼接
|
||||
* @return
|
||||
*/
|
||||
Page<StoreMemberDistributionVo> listPageXml(@Param("page")Page<StoreMemberDistribution> page, @Param("sql")String sql);
|
||||
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺会员;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-30
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StoreMemberMapper extends BaseMapperPlus<StoreMember, StoreMemberVo> {
|
||||
|
||||
/**
|
||||
* 列表分页条件查询
|
||||
* @param page 分页构造
|
||||
* @param sql sql条件拼接
|
||||
* @return
|
||||
*/
|
||||
Page<StoreMemberVo> listPageXml(@Param("page")Page<StoreMember> page, @Param("sql")String sql);
|
||||
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sxpcwlkj.mobile.entity.StoreToolArea;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface StoreToolAreaMapper extends BaseMapper<StoreToolArea> {
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertisingLocation;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreAdvertisingLocationBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingLocationVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广告位;
|
||||
* 支持自定义扩展,已继承接口:insert、deleteById、updateById、selectById、getByEntityListPage(更多查看BaseService接口)
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
public interface StoreAdvertisingLocationService extends BaseService<StoreAdvertisingLocation, StoreAdvertisingLocationVo, StoreAdvertisingLocationBo> {
|
||||
|
||||
|
||||
StoreAdvertisingLocationVo selectVoListByCode(String code);
|
||||
|
||||
List<StoreAdvertisingLocationVo> selectVoList(LambdaQueryWrapper<StoreAdvertisingLocation> storeAdvertisingLocationLambdaQueryWrapper);
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service;
|
||||
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertising;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreAdvertisingBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广告;
|
||||
* 支持自定义扩展,已继承接口:insert、deleteById、updateById、selectById、getByEntityListPage(更多查看BaseService接口)
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
public interface StoreAdvertisingService extends BaseService<StoreAdvertising, StoreAdvertisingVo, StoreAdvertisingBo> {
|
||||
|
||||
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAddress;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberAddressBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberAddressVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收件地址;
|
||||
* 支持自定义扩展,已继承接口:insert、deleteById、updateById、selectById、getByEntityListPage(更多查看BaseService接口)
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
public interface StoreMemberAddressService extends BaseService<StoreMemberAddress, StoreMemberAddressVo, StoreMemberAddressBo> {
|
||||
StoreMemberAddressVo selectVoByIdAndMid(String id, String id1);
|
||||
|
||||
Boolean deleteByIdAndMid(String id, String id1);
|
||||
|
||||
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service;
|
||||
|
||||
import com.sxpcwlkj.common.utils.R;
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberBo;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberUpdateBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberVo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 店铺会员;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-30
|
||||
*/
|
||||
public interface StoreMemberService extends BaseService<StoreMember, StoreMemberVo, StoreMemberBo> {
|
||||
|
||||
/**
|
||||
* 根据手机号查会员
|
||||
* @param phoneNumber
|
||||
* @return
|
||||
*/
|
||||
StoreMemberVo selectVoByPhone(String phoneNumber);
|
||||
/**
|
||||
* 根据openid号查会员
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
StoreMemberVo selectVoByOpenId(String openId);
|
||||
/**
|
||||
* 根据账号
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
StoreMemberVo selectVoByAccount(String account);
|
||||
|
||||
/**
|
||||
* 根据邀请码
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
StoreMemberVo selectVoByInvitationCode(String code);
|
||||
|
||||
/**
|
||||
* 生成一个可用的邀请码
|
||||
* @return
|
||||
*/
|
||||
String getInvitationCode();
|
||||
|
||||
R<String> updateMember(StoreMemberUpdateBo bo);
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
* @param a 正面
|
||||
* @param b 背面
|
||||
* @return
|
||||
*/
|
||||
R<Map<String, String>> authentication(String a, String b);
|
||||
}
|
||||
@ -1,123 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertising;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertisingLocation;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreAdvertisingLocationBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingLocationVo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingVo;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreAdvertisingLocationMapper;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreAdvertisingMapper;
|
||||
import com.sxpcwlkj.mobile.service.StoreAdvertisingLocationService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 广告位;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("store_advertising_location")
|
||||
@RequiredArgsConstructor
|
||||
public class StoreAdvertisingLocationServiceImpl extends BaseServiceImpl<StoreAdvertisingLocation, StoreAdvertisingLocationVo, StoreAdvertisingLocationBo> implements StoreAdvertisingLocationService {
|
||||
|
||||
private final StoreAdvertisingLocationMapper baseMapper;
|
||||
private final StoreAdvertisingMapper storeAdvertisingMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<StoreAdvertisingLocation, StoreAdvertisingLocationVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean insert(StoreAdvertisingLocationBo bo) {
|
||||
int row = 0;
|
||||
StoreAdvertisingLocation obj = MapstructUtil.convert(bo, StoreAdvertisingLocation.class);
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable id) {
|
||||
return this.getBaseMapper().deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(StoreAdvertisingLocationBo bo) {
|
||||
int row = 0;
|
||||
StoreAdvertisingLocation obj = MapstructUtil.convert(bo, StoreAdvertisingLocation.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAdvertisingLocationVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<StoreAdvertisingLocationVo> selectListVoPage(StoreAdvertisingLocationBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<StoreAdvertisingLocation> lqw = buildQueryWrapper(bo);
|
||||
Page<StoreAdvertisingLocationVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
|
||||
private LambdaQueryWrapper<StoreAdvertisingLocation> buildQueryWrapper(StoreAdvertisingLocationBo query) {
|
||||
if (query == null) {
|
||||
query = new StoreAdvertisingLocationBo();
|
||||
}
|
||||
//Map<String, Object> params = query.getParams();
|
||||
LambdaQueryWrapper<StoreAdvertisingLocation> wrapper = Wrappers.lambdaQuery();
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAdvertisingLocationVo selectVoListByCode(String code) {
|
||||
StoreAdvertisingLocationVo vo = null;
|
||||
if (StringUtil.isNotBlank(code)) {
|
||||
LambdaQueryWrapper<StoreAdvertisingLocation> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StoreAdvertisingLocation::getCode, code);
|
||||
vo = this.getBaseMapper().selectVoOne(lqw);
|
||||
if (vo != null) {
|
||||
List<StoreAdvertisingVo> ads= storeAdvertisingMapper.selectVoList(new LambdaQueryWrapper<StoreAdvertising>()
|
||||
.eq(StoreAdvertising::getAdvertisingId, vo.getId())
|
||||
.eq(StoreAdvertising::getStatus, 0)
|
||||
.le(StoreAdvertising::getStartTime, new Date())
|
||||
.ge(StoreAdvertising::getEndTime, new Date())
|
||||
.orderByDesc(StoreAdvertising::getSort)
|
||||
.last("limit "+vo.getMaxNum())
|
||||
);
|
||||
vo.setStoreAdvertisingList(ads);
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreAdvertisingLocationVo> selectVoList(LambdaQueryWrapper<StoreAdvertisingLocation> storeAdvertisingLocationLambdaQueryWrapper) {
|
||||
return selectVoList(storeAdvertisingLocationLambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.BaseService;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.mobile.entity.StoreAdvertising;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreAdvertisingBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingVo;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreAdvertisingMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 广告;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("store_advertising")
|
||||
@RequiredArgsConstructor
|
||||
public class StoreAdvertisingServiceImpl extends BaseServiceImpl<StoreAdvertising, StoreAdvertisingVo,StoreAdvertisingBo> implements BaseService<StoreAdvertising, StoreAdvertisingVo, StoreAdvertisingBo> {
|
||||
|
||||
private final StoreAdvertisingMapper baseMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<StoreAdvertising, StoreAdvertisingVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean insert(StoreAdvertisingBo bo) {
|
||||
int row = 0;
|
||||
StoreAdvertising obj = MapstructUtil.convert(bo, StoreAdvertising.class);
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable id) {
|
||||
return this.getBaseMapper().deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(StoreAdvertisingBo bo) {
|
||||
int row = 0;
|
||||
StoreAdvertising obj = MapstructUtil.convert(bo, StoreAdvertising.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAdvertisingVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<StoreAdvertisingVo> selectListVoPage(StoreAdvertisingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<StoreAdvertising> lqw = buildQueryWrapper(bo);
|
||||
Page<StoreAdvertisingVo> page = null;
|
||||
//baseMapper.selectPageVo(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
|
||||
private LambdaQueryWrapper<StoreAdvertising> buildQueryWrapper(StoreAdvertisingBo query){
|
||||
if(query==null){
|
||||
query=new StoreAdvertisingBo();
|
||||
}
|
||||
LambdaQueryWrapper<StoreAdvertising> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getAdvertisingLocationId()), StoreAdvertising::getAdvertisingId, query.getAdvertisingLocationId());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getStartTime()), StoreAdvertising::getStartTime, query.getStartTime());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getEndTime()), StoreAdvertising::getEndTime, query.getEndTime());
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,101 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sxpcwlkj.common.utils.MapstructUtil;
|
||||
import com.sxpcwlkj.common.utils.StringUtil;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAddress;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberAddressBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberAddressVo;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreMemberAddressMapper;
|
||||
import com.sxpcwlkj.mobile.service.StoreMemberAddressService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 会员收件地址;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-05-11
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("store_member_address")
|
||||
@RequiredArgsConstructor
|
||||
public class StoreMemberAddressServiceImpl extends BaseServiceImpl<StoreMemberAddress, StoreMemberAddressVo,StoreMemberAddressBo> implements StoreMemberAddressService {
|
||||
|
||||
private final StoreMemberAddressMapper baseMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<StoreMemberAddress, StoreMemberAddressVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean insert(StoreMemberAddressBo bo) {
|
||||
int row = 0;
|
||||
StoreMemberAddress obj = MapstructUtil.convert(bo, StoreMemberAddress.class);
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable id) {
|
||||
return this.getBaseMapper().deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(StoreMemberAddressBo bo) {
|
||||
int row = 0;
|
||||
StoreMemberAddress obj = MapstructUtil.convert(bo, StoreMemberAddress.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberAddressVo selectVoById(Serializable id) {
|
||||
return this.getBaseMapper().selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<StoreMemberAddressVo> selectListVoPage(StoreMemberAddressBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<StoreMemberAddress> lqw = buildQueryWrapper(bo);
|
||||
Page<StoreMemberAddressVo> page = baseMapper.selectVoPage(pageQuery.build(),lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
|
||||
private LambdaQueryWrapper<StoreMemberAddress> buildQueryWrapper(StoreMemberAddressBo query){
|
||||
if(query==null){
|
||||
query=new StoreMemberAddressBo();
|
||||
}
|
||||
//Map<String, Object> params = query.getParams();
|
||||
|
||||
LambdaQueryWrapper<StoreMemberAddress> wrapper = Wrappers.lambdaQuery();
|
||||
|
||||
wrapper.eq(StringUtil.isNotBlank(query.getMemberId()),StoreMemberAddress::getMemberId,query.getMemberId());
|
||||
wrapper.orderByDesc(StoreMemberAddress::getTolerant);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberAddressVo selectVoByIdAndMid(String id, String mid) {
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<StoreMemberAddress>().eq(StoreMemberAddress::getMemberId, mid).eq(StoreMemberAddress::getId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteByIdAndMid(String id, String mid) {
|
||||
return baseMapper.delete(new LambdaQueryWrapper<StoreMemberAddress>().eq(StoreMemberAddress::getMemberId,mid).eq(StoreMemberAddress::getId,id))>0;
|
||||
}
|
||||
}
|
||||
@ -1,295 +0,0 @@
|
||||
package com.sxpcwlkj.mobile.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.sxpcwlkj.authority.LoginObject;
|
||||
import com.sxpcwlkj.common.exception.MmsException;
|
||||
import com.sxpcwlkj.common.utils.*;
|
||||
import com.sxpcwlkj.datasource.entity.page.PageQuery;
|
||||
import com.sxpcwlkj.datasource.entity.page.TableDataInfo;
|
||||
import com.sxpcwlkj.datasource.mapper.BaseMapperPlus;
|
||||
|
||||
import com.sxpcwlkj.framework.sercice.impl.BaseServiceImpl;
|
||||
|
||||
|
||||
import com.sxpcwlkj.mobile.entity.StoreMember;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberAuthentication;
|
||||
import com.sxpcwlkj.mobile.entity.StoreMemberDistribution;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberBo;
|
||||
import com.sxpcwlkj.mobile.entity.bo.StoreMemberUpdateBo;
|
||||
import com.sxpcwlkj.mobile.entity.vo.StoreMemberVo;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreMemberDistributionMapper;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreMemberMapper;
|
||||
import com.sxpcwlkj.mobile.mapper.StoreMemberAuthenticationMapper;
|
||||
import com.sxpcwlkj.mobile.service.StoreMemberService;
|
||||
import com.sxpcwlkj.redis.RedisUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.Duration;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺会员;
|
||||
*
|
||||
* @author 西决 942879858@qq.com
|
||||
* @since 1.0.0 2024-01-30
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("store_member")
|
||||
@RequiredArgsConstructor
|
||||
public class StoreMemberServiceImpl extends BaseServiceImpl<StoreMember, StoreMemberVo, StoreMemberBo> implements StoreMemberService {
|
||||
|
||||
private final StoreMemberMapper baseMapper;
|
||||
private final StoreMemberDistributionMapper storeMemberDistributionMapper;
|
||||
private final StoreMemberAuthenticationMapper storeMemberAuthenticationMapper;
|
||||
private final Environment environment;
|
||||
|
||||
@Override
|
||||
public BaseMapperPlus<StoreMember, StoreMemberVo> getBaseMapper() {
|
||||
return baseMapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean insert(StoreMemberBo bo) {
|
||||
int row = 0;
|
||||
|
||||
String invitationCode= bo.getInvitationCode();
|
||||
|
||||
// 生成一个可用的邀请码
|
||||
String code = getInvitationCode();
|
||||
bo.setInvitationCode(code);
|
||||
StoreMember obj = MapstructUtil.convert(bo, StoreMember.class);
|
||||
row = this.getBaseMapper().insert(obj);
|
||||
|
||||
//关系记录
|
||||
|
||||
if(StringUtil.isNotEmpty(invitationCode)){
|
||||
StoreMemberVo isInvitationCode = this.selectVoByInvitationCode(invitationCode);
|
||||
if(isInvitationCode!=null){
|
||||
StoreMemberDistribution memberDistribution=new StoreMemberDistribution();
|
||||
memberDistribution.setMemberId(obj.getId());
|
||||
memberDistribution.setReferrerId(isInvitationCode.getId());
|
||||
memberDistribution.setFatherIdOne(isInvitationCode.getId());
|
||||
storeMemberDistributionMapper.insert(memberDistribution);
|
||||
}
|
||||
}
|
||||
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteById(Serializable id) {
|
||||
return this.getBaseMapper().deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateById(StoreMemberBo bo) {
|
||||
int row = 0;
|
||||
StoreMember obj = MapstructUtil.convert(bo, StoreMember.class);
|
||||
row = this.getBaseMapper().updateById(obj);
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberVo selectVoById(Serializable id) {
|
||||
StoreMemberVo memberVo = this.getBaseMapper().selectVoById(id);
|
||||
StoreMemberAuthentication authentication = storeMemberAuthenticationMapper.selectOne(new LambdaQueryWrapper<StoreMemberAuthentication>().eq(StoreMemberAuthentication::getMemberId, memberVo.getId()).last("LIMIT 1"));
|
||||
if (authentication != null) {
|
||||
memberVo.setAuthentication(authentication);
|
||||
}
|
||||
return memberVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<StoreMemberVo> selectListVoPage(StoreMemberBo bo, PageQuery pageQuery) {
|
||||
Page<StoreMemberVo> page = baseMapper.listPageXml(pageQuery.build(), this.buildQueryWrapper(bo).getCustomSqlSegment());
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
|
||||
private Wrapper<StoreMember> buildQueryWrapper(StoreMemberBo query) {
|
||||
|
||||
LambdaQueryWrapper<StoreMember> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getId()), StoreMember::getId, query.getId());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getAccount()), StoreMember::getAccount, query.getAccount());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getSex()), StoreMember::getSex, query.getSex());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getPhone()), StoreMember::getPhone, query.getPhone());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getWxOpenid()), StoreMember::getWxOpenid, query.getWxOpenid());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getLevel()), StoreMember::getLevel, query.getLevel());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getInvitationCode()), StoreMember::getInvitationCode, query.getInvitationCode());
|
||||
wrapper.eq(StringUtil.isNotEmpty(query.getStatus()), StoreMember::getStatus, query.getStatus());
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberVo selectVoByPhone(String phoneNumber) {
|
||||
StoreMemberVo memberVo = baseMapper.selectVoOne(new LambdaQueryWrapper<StoreMember>().eq(StoreMember::getPhone, phoneNumber).last("LIMIT 1"));
|
||||
if(memberVo==null){
|
||||
return memberVo;
|
||||
}
|
||||
StoreMemberAuthentication authentication = storeMemberAuthenticationMapper.selectOne(new LambdaQueryWrapper<StoreMemberAuthentication>().eq(StoreMemberAuthentication::getMemberId, memberVo.getId()).last("LIMIT 1"));
|
||||
if (authentication != null) {
|
||||
memberVo.setAuthentication(authentication);
|
||||
}
|
||||
return memberVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberVo selectVoByOpenId(String openId) {
|
||||
StoreMemberVo memberVo = baseMapper.selectVoOne(new LambdaQueryWrapper<StoreMember>().eq(StoreMember::getWxOpenid, openId).last("LIMIT 1"));
|
||||
if(memberVo==null){
|
||||
return memberVo;
|
||||
}
|
||||
StoreMemberAuthentication authentication = storeMemberAuthenticationMapper.selectOne(new LambdaQueryWrapper<StoreMemberAuthentication>().eq(StoreMemberAuthentication::getMemberId, memberVo.getId()).last("LIMIT 1"));
|
||||
if (authentication != null) {
|
||||
memberVo.setAuthentication(authentication);
|
||||
}
|
||||
return memberVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberVo selectVoByAccount(String account) {
|
||||
StoreMemberVo memberVo = baseMapper.selectVoOne(new LambdaQueryWrapper<StoreMember>().and(
|
||||
wrapper -> {
|
||||
wrapper.eq(StoreMember::getAccount, account).or().eq(StoreMember::getPhone, account);
|
||||
}
|
||||
).last("LIMIT 1"));
|
||||
if(memberVo==null){
|
||||
throw new MmsException("账号不存在!");
|
||||
}
|
||||
StoreMemberAuthentication authentication = storeMemberAuthenticationMapper.selectOne(new LambdaQueryWrapper<StoreMemberAuthentication>().eq(StoreMemberAuthentication::getMemberId, memberVo.getId()).last("LIMIT 1"));
|
||||
if (authentication != null) {
|
||||
memberVo.setAuthentication(authentication);
|
||||
}
|
||||
return memberVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreMemberVo selectVoByInvitationCode(String code) {
|
||||
StoreMemberVo memberVo = baseMapper.selectVoOne(new LambdaQueryWrapper<StoreMember>().eq(StoreMember::getInvitationCode, code).last("LIMIT 1"));
|
||||
if (memberVo==null){
|
||||
return memberVo;
|
||||
}
|
||||
StoreMemberAuthentication authentication = storeMemberAuthenticationMapper.selectOne(new LambdaQueryWrapper<StoreMemberAuthentication>().eq(StoreMemberAuthentication::getMemberId, memberVo.getId()).last("LIMIT 1"));
|
||||
if (authentication != null) {
|
||||
memberVo.setAuthentication(authentication);
|
||||
}
|
||||
return memberVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvitationCode() {
|
||||
String code = RandomUtil.getInvitationCode();
|
||||
StoreMemberVo vo = this.selectVoByInvitationCode(code);
|
||||
if(vo!=null){
|
||||
getInvitationCode();
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<String> updateMember(StoreMemberUpdateBo bo) {
|
||||
//1:手机号 2:密码 3:昵称 4:头像 5:性别 6:账号 7:生日
|
||||
int row = 0;
|
||||
if(bo.getType()==1){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getPhone,bo.getPhone()));
|
||||
}
|
||||
if(bo.getType()==2){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getPassword,bo.getPassword()));
|
||||
}
|
||||
if(bo.getType()==3){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getNickname,bo.getNickname()));
|
||||
}
|
||||
if(bo.getType()==4){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getHeadPortrait,bo.getHeadPortrait()));
|
||||
}
|
||||
if(bo.getType()==5){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getSex,bo.getSex()));
|
||||
}
|
||||
if(bo.getType()==6){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getAccount,bo.getAccount()));
|
||||
}
|
||||
if(bo.getType()==7){
|
||||
row = baseMapper.update(null,new LambdaUpdateWrapper<StoreMember>().eq(StoreMember::getId,bo.getMemberId()).set(StoreMember::getBirthday,bo.getBirthday()));
|
||||
}
|
||||
|
||||
if(row>0){
|
||||
return R.success("修改成功");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Map<String, String>> authentication(String a, String b) {
|
||||
// 获取身份证信息
|
||||
StoreMember storeMember = LoginObject.getLoginObject(StoreMember.class);
|
||||
|
||||
StoreMemberAuthentication selectOne = storeMemberAuthenticationMapper.selectOne(new LambdaQueryWrapper<StoreMemberAuthentication>()
|
||||
.eq(StoreMemberAuthentication::getMemberId, storeMember.getId()));
|
||||
|
||||
if (selectOne != null) {
|
||||
return R.fail("您已经认证过了");
|
||||
}
|
||||
|
||||
if (environment.getProperty("spring.profiles.active").equals("prod")) {
|
||||
try {
|
||||
log.info("authentication:" + storeMember.getId());
|
||||
Object s = RedisUtil.getCacheObject("authentication:" + storeMember.getId());
|
||||
int num = Convert.toInt(s == null ? 0 : Convert.toInt(s), 0);
|
||||
if (num >= 5) {
|
||||
log.info("实名认证>=5,拦截:" + storeMember.getId());
|
||||
return R.fail("操作频繁,请24小时后再试哦!");
|
||||
}
|
||||
num++;
|
||||
RedisUtil.setCacheObject("authentication:" + storeMember.getId(), num);
|
||||
RedisUtil.setCacheObject("authentication:" + storeMember.getId(), num, Duration.ofDays(1));
|
||||
} catch (Exception e) {
|
||||
throw new MmsException("实名认证失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
R<Map<String, String>> icrdInfo = OcrIdcardUtil.getIcrdInfo(a, storeMember.getPhone());
|
||||
if (icrdInfo.getCode() == 200) {
|
||||
Map<String, String> data = icrdInfo.getData();
|
||||
String name = data.get("name");
|
||||
String number = data.get("num");
|
||||
String address = data.get("address");
|
||||
String nationality = data.get("nationality");
|
||||
String sex = data.get("sex");
|
||||
StoreMemberAuthentication bo=new StoreMemberAuthentication();
|
||||
bo.setMemberId(storeMember.getId());
|
||||
bo.setName(name);
|
||||
bo.setNumber(number);
|
||||
bo.setAddress(address);
|
||||
bo.setSex(sex);
|
||||
bo.setNationality(nationality);
|
||||
bo.setPhone(storeMember.getPhone());
|
||||
bo.setImageFront(a);
|
||||
bo.setImageBack(b);
|
||||
bo.setStatus(1);
|
||||
bo.setCreatedTime(new Date());
|
||||
bo.setUpdatedTime(new Date());
|
||||
bo.setCreatedBy(0L);
|
||||
bo.setUpdatedBy(0L);
|
||||
storeMemberAuthenticationMapper.insert(bo);
|
||||
}
|
||||
return icrdInfo;
|
||||
|
||||
}
|
||||
}
|
||||
@ -19,7 +19,7 @@ sxpcwlkj:
|
||||
--- # 环境配置
|
||||
server:
|
||||
# 服务端口,默认为8080
|
||||
port: 8090
|
||||
port: 8070
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@ -68,6 +68,18 @@ spring:
|
||||
# 允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
|
||||
web:
|
||||
is-open: true
|
||||
# 排除路径
|
||||
excludes:
|
||||
# 放行
|
||||
- /static/**, # 静态资源目录
|
||||
- /public/**, # 公共资源目录
|
||||
- /resources/**, # 默认资源路径
|
||||
- /favicon.ico, # 网站图标
|
||||
- /error # 错误页面
|
||||
- /.well-known/**
|
||||
|
||||
--- # Sa-Token配置
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreAdvertisingLocationMapper">
|
||||
|
||||
</mapper>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreAdvertisingMapper">
|
||||
|
||||
</mapper>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreMapper">
|
||||
|
||||
<!-- 需要后面追加 $ {sql} 开启条件查询 -->
|
||||
<select id="listPageXml" resultType="com.sxpcwlkj.mobile.entity.vo.StoreVo">
|
||||
SELECT * FROM `store` <!-- $ {sql} -->
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreMemberAddressMapper">
|
||||
|
||||
</mapper>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreMemberDistributionMapper">
|
||||
|
||||
<!-- 需要后面追加 $ {ew.customSqlSegment} 开启条件查询【注意取消$后的空格】 -->
|
||||
<!-- <select id="listPageXml" resultType="com.sxpcwlkj.mobile.entity.vo.MemberDistributionVo">-->
|
||||
<!-- SELECT * FROM `member_distribution` <!– $ {ew.customSqlSegment} –>-->
|
||||
<!-- </select>-->
|
||||
|
||||
</mapper>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreMemberMapper">
|
||||
|
||||
<!-- 需要后面追加 $ {ew.customSqlSegment} 开启条件查询【注意取消$后的空格】 -->
|
||||
<select id="listPageXml" resultType="com.sxpcwlkj.mobile.entity.vo.StoreMemberVo">
|
||||
SELECT * FROM `store_member` <!-- $ {ew.customSqlSegment} -->
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sxpcwlkj.mobile.mapper.StoreAdvertisingMapper">
|
||||
|
||||
<select id="selectVoListXml" resultType="com.sxpcwlkj.mobile.entity.vo.StoreAdvertisingVo">
|
||||
SELECT
|
||||
ad.*
|
||||
FROM
|
||||
`store_advertising` ad
|
||||
LEFT JOIN `store_advertising_position` adp
|
||||
ON ad.`advertising_id` = adp.`id`
|
||||
WHERE adp.`status` = 0
|
||||
AND ad.`status` = 0
|
||||
AND NOW() >= ad.`start_time`
|
||||
AND NOW() <= ad.`end_time`
|
||||
AND adp.`id`=#{adpId}
|
||||
ORDER BY ad.`sort` DESC LIMIT #{size}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user