新增接口:获得客户端配置文件文件id
通过版本号获得对应客户端文件id
This commit is contained in:
@ -1,7 +1,9 @@
|
|||||||
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.controller;
|
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.controller;
|
||||||
|
|
||||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidClientVersion;
|
||||||
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse;
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidClientVersionService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidTemplateWarehouseService;
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidTemplateWarehouseService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@ -16,6 +18,8 @@ import javax.annotation.Resource;
|
|||||||
public class TemplateWarehouseController {
|
public class TemplateWarehouseController {
|
||||||
@Resource
|
@Resource
|
||||||
private BizBidTemplateWarehouseService templateWarehouseService;
|
private BizBidTemplateWarehouseService templateWarehouseService;
|
||||||
|
@Resource
|
||||||
|
private BizBidClientVersionService bizBidClientVersionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过模板类型查询模板数据
|
* 通过模板类型查询模板数据
|
||||||
@ -44,4 +48,29 @@ public class TemplateWarehouseController {
|
|||||||
Boolean result = templateWarehouseService.insertTemplate(templateWarehouse);
|
Boolean result = templateWarehouseService.insertTemplate(templateWarehouse);
|
||||||
return BaseResponse.success(result);
|
return BaseResponse.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得客户端配置文件相关信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("获得客户端配置文件文件id")
|
||||||
|
@GetMapping("/client/file")
|
||||||
|
public BaseResponse<BizBidTemplateWarehouse> getClientFile(){
|
||||||
|
String type = "ipassConfigFile";
|
||||||
|
BizBidTemplateWarehouse templateWarehouse = templateWarehouseService.getTemplateByType(type);
|
||||||
|
return BaseResponse.success(templateWarehouse);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过版本号获得对应客户端文件id
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("通过版本号获得对应客户端文件id")
|
||||||
|
@GetMapping("/client/{version}")
|
||||||
|
public BaseResponse<BizBidClientVersion> getClientByVersion(@ApiParam(value = "版本号", required = true) @PathVariable String version){
|
||||||
|
BizBidClientVersion clientVersion = bizBidClientVersionService.getClientByVersion(version);
|
||||||
|
return BaseResponse.success(clientVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.dao;
|
||||||
|
|
||||||
|
|
||||||
|
import com.chinaunicom.mall.ebtp.common.base.dao.IBaseMapper;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidClientVersion;
|
||||||
|
|
||||||
|
public interface BizBidClientVersionMapper extends IBaseMapper<BizBidClientVersion> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
<?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.chinaunicom.mall.ebtp.extend.templatewarehouse.dao.BizBidClientVersionMapper">
|
||||||
|
<resultMap id="BaseResultMap"
|
||||||
|
type="com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidClientVersion">
|
||||||
|
<result column="id" jdbcType="BIGINT" property="id"/>
|
||||||
|
<result column="document_center_id" jdbcType="VARCHAR" property="documentCenterId"/>
|
||||||
|
<result column="ipass_version" jdbcType="VARCHAR" property="ipassVersion"/>
|
||||||
|
<result column="publish_date" jdbcType="TIMESTAMP" property="publishDate"/>
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.chinaunicom.mall.ebtp.common.base.entity.BaseEntity;
|
||||||
|
import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体类 BizBidClientVersion
|
||||||
|
*
|
||||||
|
* @auto.generated
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel
|
||||||
|
@TableName(value = "biz_bid_client_version", autoResultMap = true)
|
||||||
|
public class BizBidClientVersion implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档中心-文档ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "文档中心-文档ID")
|
||||||
|
private String documentCenterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ipass客户端版本号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "ipass客户端版本号")
|
||||||
|
private String ipassVersion;
|
||||||
|
|
||||||
|
@TableField(
|
||||||
|
fill = FieldFill.INSERT,
|
||||||
|
typeHandler = CustomLocalDateTimeTypeHandler.class
|
||||||
|
)
|
||||||
|
@JsonFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
@DateTimeFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
@ApiModelProperty("客户端发布时间")
|
||||||
|
private LocalDateTime publishDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ipass客户端版本号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice;
|
||||||
|
|
||||||
|
|
||||||
|
import com.chinaunicom.mall.ebtp.common.base.service.IBaseService;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidClientVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对数据表 biz_bid_client_version 操作的 service
|
||||||
|
* @author Auto create
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface BizBidClientVersionService extends IBaseService<BizBidClientVersion>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过版本号获得对应客户端文件id
|
||||||
|
* @param version
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BizBidClientVersion getClientByVersion(String version);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidClientVersion;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.dao.BizBidClientVersionMapper;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidClientVersionService;
|
||||||
|
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
|
||||||
|
/**
|
||||||
|
* 对数据表 biz_bid_client_version 操作的 serviceImpl
|
||||||
|
* @author Auto create
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BizBidClientVersionServiceImpl extends BaseServiceImpl<BizBidClientVersionMapper, BizBidClientVersion> implements BizBidClientVersionService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BizBidClientVersion getClientByVersion(String version) {
|
||||||
|
QueryWrapper<BizBidClientVersion> query = new QueryWrapper<>(new BizBidClientVersion().setIpassVersion(version));
|
||||||
|
return this.getOne(query);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user