Commit 8a3c2fc9 by liyanlin

1、新增跟进appId获取小程序配置接口;

2、增加swagger header配置。
parent eaa1f9b8
......@@ -54,9 +54,12 @@ public class Swagger2Config {
appType.name("sourceFrom").description("应用类型").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
ParameterBuilder appToken = new ParameterBuilder();
appToken.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
ParameterBuilder appBrandId = new ParameterBuilder();
appBrandId.name("brandId").description("品牌ID").modelRef(new ModelRef("integer")).parameterType("header").required(false).build();
List<Parameter> pars = new ArrayList<>();
pars.add(appType.build());
pars.add(appToken.build());
pars.add(appBrandId.build());
return pars;
}
......
package com.gogirl.interfaces.common;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gogirl.application.common.xcx.impl.MiniappBrandConfigService;
import com.gogirl.domain.common.xcx.MiniappBrandConfig;
import com.gogirl.infrastructure.common.base.JsonResult;
import com.gogirl.infrastructure.common.config.config.WxPayConfig;
import com.gogirl.shared.user.ReadMessageCommand;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.web.JsonPath;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.websocket.server.PathParam;
import java.lang.reflect.Field;
/**
......@@ -25,10 +30,24 @@ import java.lang.reflect.Field;
@Slf4j
public class MiniappBrandConfigController {
@ApiModelProperty("获取小程序模板")
@Resource
private MiniappBrandConfigService miniappBrandConfigService;
@Deprecated
@ApiOperation("获取小程序模板,不建议使用")
@GetMapping(value = {"/customer/miniapp/brand/config/tpl","/technician/miniapp/brand/config/tpl"})
public JsonResult<MiniappBrandConfig> tpl(@RequestHeader("brandId") Integer brandId) {
MiniappBrandConfig config = WxPayConfig.brandMap.get(brandId);
return JsonResult.success(config);
}
@ApiOperation("获取小程序模板")
@GetMapping(value = {"/customer/miniapp/brand/configuration/tpl","/technician/miniapp/brand/configuration/tpl"})
public JsonResult<MiniappBrandConfig> tpl(@RequestParam String appId) {
MiniappBrandConfig config = miniappBrandConfigService.getOne(
new LambdaQueryWrapper<MiniappBrandConfig>()
.eq(MiniappBrandConfig::getStoreMiniappId,appId)
);
return JsonResult.success(config);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment