feat:askbot 门店获取方式变更
This commit is contained in:
@@ -148,7 +148,7 @@ public enum ErrorCodeEnum {
|
|||||||
LINE_ALREADY_EXISTS(10211163, "该线索已存在,跟进人为{0}", null),
|
LINE_ALREADY_EXISTS(10211163, "该线索已存在,跟进人为{0}", null),
|
||||||
LINE_EXISTS_IN_PUBLIC_SEA(10211164, "该线索已存在,请前往公海认领", null),
|
LINE_EXISTS_IN_PUBLIC_SEA(10211164, "该线索已存在,请前往公海认领", null),
|
||||||
CONTENT_DUPLICATED(10211200, "动态标题重复!", null),
|
CONTENT_DUPLICATED(10211200, "动态标题重复!", null),
|
||||||
SIGN_FAIL(600000, "验签失败", null),
|
SIGN_FAIL(600000, "验签失败=>{0}", null),
|
||||||
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误!", null),
|
GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误!", null),
|
||||||
NEW_MOBILE_HAS_EXIST(600002,"加盟商用户信息已存在",null),
|
NEW_MOBILE_HAS_EXIST(600002,"加盟商用户信息已存在",null),
|
||||||
INSPECTION_USER_OCCUPY(600003,"当前稽核人已经配置其他战区",null),
|
INSPECTION_USER_OCCUPY(600003,"当前稽核人已经配置其他战区",null),
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/5/13 9:57
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public enum ExtendFieldTypeEnum {
|
||||||
|
|
||||||
|
TEST_STORE_MANAGER_MOBILE("extend_field_1746670633436","店长手机号"),
|
||||||
|
TEST_SIGNATORY_NAME_1("extend_field_1746670645231","签约人1名称"),
|
||||||
|
TEST_SIGNATORY_MOBILE_1("extend_field_1746670652805","签约人2手机号"),
|
||||||
|
TEST_SIGNATORY_NAME_2("extend_field_1746670671614","签约人2名称"),
|
||||||
|
TEST_SIGNATORY_MOBILE_2("extend_field_1746670686307","签约人2手机号"),
|
||||||
|
TEST_ORDER_NAME("extend_field_1747103227333","订单小程序名称"),
|
||||||
|
ONLINE_STORE_MANAGER_MOBILE("extend_field_1746598536903","店长手机号"),
|
||||||
|
ONLINE_SIGNATORY_NAME_1("extend_field_1746598562255","签约人1名称"),
|
||||||
|
ONLINE_SIGNATORY_MOBILE_1("extend_field_1746598570479","签约人2手机号"),
|
||||||
|
ONLINE_SIGNATORY_NAME_2("extend_field_1746598584139","签约人2名称"),
|
||||||
|
ONLINE_SIGNATORY_MOBILE_2("extend_field_1746598594140","签约人2手机号"),
|
||||||
|
ONLINE_ORDER_NAME("extend_field_1746599049206","订单小程序名称"),;
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
ExtendFieldTypeEnum(String key,String msg){
|
||||||
|
this.key = key;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, ExtendFieldTypeEnum> configMap(){
|
||||||
|
return Arrays.stream(ExtendFieldTypeEnum.values())
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
ExtendFieldTypeEnum::getKey,
|
||||||
|
e -> e
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey(String key) {
|
||||||
|
this.key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -63,5 +63,9 @@ public class StoreDao {
|
|||||||
return storeMapper.listByMobile(mobile);
|
return storeMapper.listByMobile(mobile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<StoreDO> list() {
|
||||||
|
return storeMapper.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,10 @@ public interface StoreMapper {
|
|||||||
*/
|
*/
|
||||||
List<StoreDO> listByMobile(@Param("mobile") String mobile);
|
List<StoreDO> listByMobile(@Param("mobile") String mobile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询门店数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreDO> list();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,10 +83,16 @@
|
|||||||
select *
|
select *
|
||||||
from store_${enterpriseId}
|
from store_${enterpriseId}
|
||||||
<where>
|
<where>
|
||||||
|
and is_delete = 'effective'
|
||||||
<if test="mobile!=null and mobile !=''">
|
<if test="mobile!=null and mobile !=''">
|
||||||
and `extend_field` like concat('%', #{mobile}, '%')
|
and `extend_field` like concat('%', #{mobile}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultMap="BaseResultMap">
|
||||||
|
select *
|
||||||
|
from store_${enterpriseId} where is_delete = 'effective' order by id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/5/13 10:56
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("门店名称")
|
||||||
|
private String storeName;
|
||||||
|
@ApiModelProperty("门店CODE")
|
||||||
|
private String storeCode;
|
||||||
|
@ApiModelProperty("店长手机号")
|
||||||
|
private String managerPhone;
|
||||||
|
@ApiModelProperty("签约人1姓名")
|
||||||
|
private String signer1Name;
|
||||||
|
@ApiModelProperty("签约人2手机号")
|
||||||
|
private String signer1Phone;
|
||||||
|
@ApiModelProperty("签约人2姓名")
|
||||||
|
private String signer2Name;
|
||||||
|
@ApiModelProperty("签约人2手机号")
|
||||||
|
private String signer2Phone;
|
||||||
|
@ApiModelProperty("订单小程序名称")
|
||||||
|
private String orderMiniProgramName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/5/13 11:08
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OpenApiStoreRequest {
|
||||||
|
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
import com.cool.store.dto.StoreDTO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/5/13 9:56
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface StoreService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询门店信息 包括扩展信息
|
||||||
|
* @param pageSize
|
||||||
|
* @param pageNum
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize,Integer pageNum);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.cool.store.dao.StoreDao;
|
||||||
|
import com.cool.store.dto.StoreDTO;
|
||||||
|
import com.cool.store.entity.StoreDO;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.ExtendFieldTypeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.service.StoreService;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2025/5/13 9:56
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class StoreServiceImpl implements StoreService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
StoreDao storeDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize, Integer pageNum) {
|
||||||
|
if (pageSize>200){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE,"单次最多获取200条门店数据");
|
||||||
|
}
|
||||||
|
PageHelper.startPage(pageNum,pageSize);
|
||||||
|
List<StoreDO> list = storeDao.list();
|
||||||
|
PageInfo info = new PageInfo<>(list);
|
||||||
|
if (CollectionUtils.isEmpty(list)){
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
List<StoreDTO> storeDTOS = processStores(list);
|
||||||
|
info.setList(storeDTOS);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<StoreDTO> processStores(List<StoreDO> stores) {
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
// 创建配置映射:key -> 枚举项
|
||||||
|
Map<String, ExtendFieldTypeEnum> configMap = ExtendFieldTypeEnum.configMap();
|
||||||
|
|
||||||
|
// 处理每个门店
|
||||||
|
return stores.stream().map(store -> {
|
||||||
|
StoreDTO dto = new StoreDTO();
|
||||||
|
dto.setStoreName(store.getStoreName());
|
||||||
|
dto.setStoreCode(store.getStoreNum());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 解析门店的扩展字段
|
||||||
|
Map<String, String> extendFields = objectMapper.readValue(
|
||||||
|
store.getExtendField(),
|
||||||
|
new TypeReference<Map<String, String>>() {}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 匹配并设置DTO字段
|
||||||
|
for (Map.Entry<String, String> entry : extendFields.entrySet()) {
|
||||||
|
ExtendFieldTypeEnum fieldEnum = configMap.get(entry.getKey());
|
||||||
|
if (fieldEnum != null) {
|
||||||
|
switch (fieldEnum) {
|
||||||
|
case TEST_STORE_MANAGER_MOBILE:
|
||||||
|
case ONLINE_STORE_MANAGER_MOBILE:
|
||||||
|
dto.setManagerPhone(entry.getValue());
|
||||||
|
break;
|
||||||
|
case TEST_SIGNATORY_NAME_1:
|
||||||
|
case ONLINE_SIGNATORY_NAME_1:
|
||||||
|
dto.setSigner1Name(entry.getValue());
|
||||||
|
break;
|
||||||
|
case TEST_SIGNATORY_MOBILE_1:
|
||||||
|
case ONLINE_SIGNATORY_MOBILE_1:
|
||||||
|
dto.setSigner1Phone(entry.getValue());
|
||||||
|
break;
|
||||||
|
case TEST_SIGNATORY_NAME_2:
|
||||||
|
case ONLINE_SIGNATORY_NAME_2:
|
||||||
|
dto.setSigner2Name(entry.getValue());
|
||||||
|
break;
|
||||||
|
case TEST_SIGNATORY_MOBILE_2:
|
||||||
|
case ONLINE_SIGNATORY_MOBILE_2:
|
||||||
|
dto.setSigner2Phone(entry.getValue());
|
||||||
|
break;
|
||||||
|
case TEST_ORDER_NAME:
|
||||||
|
case ONLINE_ORDER_NAME:
|
||||||
|
dto.setOrderMiniProgramName(entry.getValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 处理JSON解析异常
|
||||||
|
log.error("解析门店扩展字段失败: {} " + store.getStoreNum());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return dto;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.cool.store.config;
|
package com.cool.store.config;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.utils.OpenSignatureUtil;
|
import com.cool.store.utils.OpenSignatureUtil;
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
import com.cool.store.utils.UUIDUtils;
|
import com.cool.store.utils.UUIDUtils;
|
||||||
@@ -11,10 +13,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.servlet.*;
|
import javax.servlet.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -48,44 +52,63 @@ public class OpenApiValidateFilter implements Filter {
|
|||||||
public void doFilter(ServletRequest servletRequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
|
public void doFilter(ServletRequest servletRequest, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
|
||||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||||
String uri = request.getRequestURI();
|
String uri = request.getRequestURI();
|
||||||
if(!uri.startsWith("/zxjp/open/v1/getYlsToken")){
|
if(!uri.startsWith("/zxjp/open/v1")){
|
||||||
filterChain.doFilter(servletRequest, response);
|
filterChain.doFilter(servletRequest, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get32UUID());
|
MDC.put(CommonConstants.REQUEST_ID, UUIDUtils.get32UUID());
|
||||||
|
//statusRefresh 放开不需要验签
|
||||||
|
if(uri.startsWith("/zxjp/open/v1/statusRefresh")){
|
||||||
|
filterChain.doFilter(servletRequest, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HttpServletResponse res = (HttpServletResponse) response;
|
||||||
// 1. 验证时间戳
|
// 1. 验证时间戳
|
||||||
try {
|
try {
|
||||||
String timestampStr = request.getHeader("timestamp");
|
String timestampStr = request.getHeader("timestamp");
|
||||||
if (timestampStr == null) {
|
if (timestampStr == null) {
|
||||||
log.info("timestampStr is null {}","缺少timestamp参数");
|
log.info("timestampStr is null {}","缺少timestamp参数");
|
||||||
throw new ServiceException(ErrorCodeEnum.SIGN_FAIL);
|
res.setStatus(HttpStatus.OK.value());
|
||||||
|
res.setCharacterEncoding("UTF-8");
|
||||||
|
res.getWriter().write(JSON.toJSONString(
|
||||||
|
ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL,"缺少timestamp参数")));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
long timestamp = Long.parseLong(timestampStr)/1000;
|
long timestamp = Long.parseLong(timestampStr)/1000;
|
||||||
long currentTime = System.currentTimeMillis()/1000;
|
long currentTime = System.currentTimeMillis()/1000;
|
||||||
long timeDiff = Math.abs(currentTime - timestamp);
|
long timeDiff = Math.abs(currentTime - timestamp);
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
if (timeDiff > 600) {
|
if (timeDiff > 600) {
|
||||||
log.info("OpenApiValidateFilter==>{}","请求已过期,服务器时间:" + currentTime + " 请求时间:" + timestamp);
|
log.info("OpenApiValidateFilter==>{}","请求已过期,服务器时间:" + currentTime + " 请求时间:" + timestamp);
|
||||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,"请求已过期,请保证timestamp时间在10分钟之内");
|
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,"请求已过期,请保证timestamp时间在10分钟之内");
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
log.info("OpenApiValidateFilter==>{}","非法timestamp格式");
|
log.info("OpenApiValidateFilter==>{}","非法timestamp格式");
|
||||||
throw new ServiceException(ErrorCodeEnum.SIGN_FAIL);
|
res.setStatus(HttpStatus.OK.value());
|
||||||
|
res.setCharacterEncoding("UTF-8");
|
||||||
|
res.getWriter().write(JSON.toJSONString(
|
||||||
|
ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL,"非法timestamp格式")));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 验证签名
|
// 2. 验证签名
|
||||||
String appKey = request.getHeader("appkey");
|
String appKey = request.getHeader("appkey");
|
||||||
if (appKey == null || !coolAppKey.equals(appKey)) {
|
if (appKey == null || !coolAppKey.equals(appKey)) {
|
||||||
log.info("OpenApiValidateFilter==>{}","无效的appKey");
|
log.info("OpenApiValidateFilter==>{}","无效的appKey");
|
||||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,"无效的appKey");
|
res.setStatus(HttpStatus.OK.value());
|
||||||
|
res.setCharacterEncoding("UTF-8");
|
||||||
|
res.getWriter().write(JSON.toJSONString(
|
||||||
|
ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL,"无效的appKey")));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String clientSign = request.getHeader("sign");
|
String clientSign = request.getHeader("sign");
|
||||||
if (clientSign == null) {
|
if (clientSign == null) {
|
||||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,"签名校验失败");
|
res.setStatus(HttpStatus.OK.value());
|
||||||
|
res.setCharacterEncoding("UTF-8");
|
||||||
|
res.getWriter().write(JSON.toJSONString(
|
||||||
|
ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL,"签名为空")));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// 1. 读取请求体
|
// 1. 读取请求体
|
||||||
StringBuilder requestBody = new StringBuilder();
|
StringBuilder requestBody = new StringBuilder();
|
||||||
@@ -112,7 +135,11 @@ public class OpenApiValidateFilter implements Filter {
|
|||||||
log.info("{}",serverSign);
|
log.info("{}",serverSign);
|
||||||
|
|
||||||
if (!serverSign.equalsIgnoreCase(clientSign)) {
|
if (!serverSign.equalsIgnoreCase(clientSign)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.SIGN_FAIL);
|
res.setStatus(HttpStatus.OK.value());
|
||||||
|
res.setCharacterEncoding("UTF-8");
|
||||||
|
res.getWriter().write(JSON.toJSONString(
|
||||||
|
ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL,"签名校验失败")));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
filterChain.doFilter(request, response);
|
filterChain.doFilter(request, response);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -4,11 +4,15 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.cool.store.dto.AskBotTokenDTO;
|
import com.cool.store.dto.AskBotTokenDTO;
|
||||||
import com.cool.store.dto.GetAccessTokenDTO;
|
import com.cool.store.dto.GetAccessTokenDTO;
|
||||||
import com.cool.store.dto.StatusRefreshDTO;
|
import com.cool.store.dto.StatusRefreshDTO;
|
||||||
|
import com.cool.store.dto.StoreDTO;
|
||||||
|
import com.cool.store.request.OpenApiStoreRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.response.bigdata.ApiResponse;
|
import com.cool.store.response.bigdata.ApiResponse;
|
||||||
import com.cool.store.service.OpenApiService;
|
import com.cool.store.service.OpenApiService;
|
||||||
import com.cool.store.service.PushService;
|
import com.cool.store.service.PushService;
|
||||||
import com.cool.store.service.ShopAccountService;
|
import com.cool.store.service.ShopAccountService;
|
||||||
|
import com.cool.store.service.StoreService;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -34,6 +38,8 @@ public class OpenApiController {
|
|||||||
PushService pushService;
|
PushService pushService;
|
||||||
@Resource
|
@Resource
|
||||||
ShopAccountService shopAccountService;
|
ShopAccountService shopAccountService;
|
||||||
|
@Resource
|
||||||
|
StoreService storeService;
|
||||||
|
|
||||||
@PostMapping("/statusRefresh")
|
@PostMapping("/statusRefresh")
|
||||||
public ApiResponse<Boolean> statusRefresh(@RequestBody StatusRefreshDTO statusRefreshDTO){
|
public ApiResponse<Boolean> statusRefresh(@RequestBody StatusRefreshDTO statusRefreshDTO){
|
||||||
@@ -49,4 +55,11 @@ public class OpenApiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("获取门店信息")
|
||||||
|
@PostMapping("/getStoreList")
|
||||||
|
public ApiResponse<PageInfo<StoreDTO>> getStoreList(@RequestBody @Validated OpenApiStoreRequest dto) {
|
||||||
|
return ApiResponse.success(storeService.getStoreExtendFieldInfo(dto.getPageSize(),dto.getPageNum()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user