Commit c23105f2 authored by lining's avatar lining

feat: 根据id查服务子类

parent 3d340cf5
......@@ -17,7 +17,19 @@
</resultMap>
<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 != ''">
<bind name="p1" value="'%' + keyWord + '%'"/>
where service_name like #{p1}
......
......@@ -84,5 +84,9 @@ public class ServiceSubclass implements Serializable {
@ApiModelProperty("文案备注")
private String description;
@Column(name = "text_description")
@ApiModelProperty("服务富文本详情")
private String textDescription;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.constraints.Positive;
/**
* <P>服务大类模块</P>
......@@ -21,6 +27,7 @@ import javax.annotation.Resource;
@Validated
public class ServiceSubclassController {
@Resource
private ServiceSubclassService serviceSubclassService;
......@@ -31,5 +38,10 @@ public class ServiceSubclassController {
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 {
@ApiModelProperty("文案备注")
private String description;
@ApiModelProperty("服务富文本详情")
private String textDescription;
}
\ No newline at end of file
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.mapper.service.ServiceSubclassMapper;
import com.onsiteservice.entity.category.ServiceSubclass;
import com.onsiteservice.miniapp.controller.category.vo.ServiceSubclassVO;
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.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
@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) {
PageHelper.startPage(dto.getPage(), dto.getSize());
......@@ -23,4 +37,6 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
return ResultGenerator.success(new PageInfoVO<>(serviceSubclassVOList));
}*/
}
......@@ -17,7 +17,7 @@ project:
# 安全路径白名单 无需token
ant-paths: "/error,**.html**,**.js,**.css,/favicon.ico,/webjars/**,/swagger**,
/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可以访问的路径白名单
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