Commit c23105f2 authored by lining's avatar lining

feat: 根据id查服务子类

parent 3d340cf5
...@@ -17,7 +17,19 @@ ...@@ -17,7 +17,19 @@
</resultMap> </resultMap>
<select id="selectByServiceNameLike" resultType="com.onsiteservice.entity.category.ServiceSubclass"> <select id="selectByServiceNameLike" resultType="com.onsiteservice.entity.category.ServiceSubclass">
select * from service_subclass select
id,
category_id,
service_name,
sequence,
img,
create_time,
modify_by,
enabled,
modify_time,
description,
create_by
from service_subclass
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
<bind name="p1" value="'%' + keyWord + '%'"/> <bind name="p1" value="'%' + keyWord + '%'"/>
where service_name like #{p1} where service_name like #{p1}
......
...@@ -84,5 +84,9 @@ public class ServiceSubclass implements Serializable { ...@@ -84,5 +84,9 @@ public class ServiceSubclass implements Serializable {
@ApiModelProperty("文案备注") @ApiModelProperty("文案备注")
private String description; private String description;
@Column(name = "text_description")
@ApiModelProperty("服务富文本详情")
private String textDescription;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.onsiteservice.miniapp.controller.category; package com.onsiteservice.miniapp.controller.category;
import com.onsiteservice.core.result.Result;
import com.onsiteservice.dao.common.page.PageInfoVO;
import com.onsiteservice.miniapp.controller.category.dto.PageServiceSubclassDTO;
import com.onsiteservice.miniapp.controller.category.vo.ServiceSubclassVO;
import com.onsiteservice.miniapp.service.category.ServiceSubclassService; import com.onsiteservice.miniapp.service.category.ServiceSubclassService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.Positive;
/** /**
* <P>服务大类模块</P> * <P>服务大类模块</P>
...@@ -21,6 +27,7 @@ import javax.annotation.Resource; ...@@ -21,6 +27,7 @@ import javax.annotation.Resource;
@Validated @Validated
public class ServiceSubclassController { public class ServiceSubclassController {
@Resource @Resource
private ServiceSubclassService serviceSubclassService; private ServiceSubclassService serviceSubclassService;
...@@ -31,5 +38,10 @@ public class ServiceSubclassController { ...@@ -31,5 +38,10 @@ public class ServiceSubclassController {
return serviceSubclassService.getPage(dto); return serviceSubclassService.getPage(dto);
}*/ }*/
@ApiOperation(value = "根据id查询服务详情")
@GetMapping("get/{id}")
public Result<ServiceSubclassVO> getDetail(@ApiParam(name = "id", value = "服务子类id") @PathVariable @Positive Long id) {
return serviceSubclassService.getDetail(id);
}
} }
...@@ -29,4 +29,7 @@ public class ServiceSubclassVO { ...@@ -29,4 +29,7 @@ public class ServiceSubclassVO {
@ApiModelProperty("文案备注") @ApiModelProperty("文案备注")
private String description; private String description;
@ApiModelProperty("服务富文本详情")
private String textDescription;
} }
\ No newline at end of file
package com.onsiteservice.miniapp.service.category; package com.onsiteservice.miniapp.service.category;
import com.onsiteservice.core.result.Result;
import com.onsiteservice.core.result.ResultGenerator;
import com.onsiteservice.dao.common.AbstractMapper; import com.onsiteservice.dao.common.AbstractMapper;
import com.onsiteservice.dao.mapper.service.ServiceSubclassMapper;
import com.onsiteservice.entity.category.ServiceSubclass; import com.onsiteservice.entity.category.ServiceSubclass;
import com.onsiteservice.miniapp.controller.category.vo.ServiceSubclassVO;
import com.onsiteservice.miniapp.mapper.category.ServiceSubclassBizMapper; import com.onsiteservice.miniapp.mapper.category.ServiceSubclassBizMapper;
import com.onsiteservice.util.AttrCopyUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
@Service @Service
@Slf4j
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> { public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
@Resource @Resource
private ServiceSubclassBizMapper serviceSubclassBizMapper; private ServiceSubclassMapper serviceSubclassMapper;
public Result<ServiceSubclassVO> getDetail(Long id) {
log.info("subclass getDetail id: {}", id);
ServiceSubclass serviceSubclass = serviceSubclassMapper.selectByPrimaryKey(id);
return ResultGenerator.success(AttrCopyUtils.copy(serviceSubclass, new ServiceSubclassVO()));
}
/*public Result<PageInfoVO<ServiceSubclassVO>> getPage(PageServiceSubclassDTO dto) { /*public Result<PageInfoVO<ServiceSubclassVO>> getPage(PageServiceSubclassDTO dto) {
PageHelper.startPage(dto.getPage(), dto.getSize()); PageHelper.startPage(dto.getPage(), dto.getSize());
...@@ -23,4 +37,6 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> { ...@@ -23,4 +37,6 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
return ResultGenerator.success(new PageInfoVO<>(serviceSubclassVOList)); return ResultGenerator.success(new PageInfoVO<>(serviceSubclassVOList));
}*/ }*/
} }
...@@ -17,7 +17,7 @@ project: ...@@ -17,7 +17,7 @@ project:
# 安全路径白名单 无需token # 安全路径白名单 无需token
ant-paths: "/error,**.html**,**.js,**.css,/favicon.ico,/webjars/**,/swagger**, ant-paths: "/error,**.html**,**.js,**.css,/favicon.ico,/webjars/**,/swagger**,
/swagger-resources/configuration/ui,/**/v2/api-docs,/doc.html,/v2/api-docs-ext,/druid/**\ /swagger-resources/configuration/ui,/**/v2/api-docs,/doc.html,/v2/api-docs-ext,/druid/**\
/,/websocket/**,/category/page,/subclass/page,/token/base,/dict,/common/*" /,/websocket/**,/category/page,/subclass/**,/token/base,/dict,/common/*"
# 基础token可以访问的路径白名单 # 基础token可以访问的路径白名单
base-token-ant-paths: "/login" base-token-ant-paths: "/login"
......
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