Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service
Commits
c23105f2
Commit
c23105f2
authored
Jul 19, 2022
by
lining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 根据id查服务子类
parent
3d340cf5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
5 deletions
+52
-5
ServiceSubclassMapper.xml
...c/main/resources/mapper/service/ServiceSubclassMapper.xml
+13
-1
ServiceSubclass.java
...va/com/onsiteservice/entity/category/ServiceSubclass.java
+4
-0
ServiceSubclassController.java
...iniapp/controller/category/ServiceSubclassController.java
+14
-2
ServiceSubclassVO.java
...ice/miniapp/controller/category/vo/ServiceSubclassVO.java
+3
-0
ServiceSubclassService.java
...vice/miniapp/service/category/ServiceSubclassService.java
+17
-1
application.yaml
mini-app/src/main/resources/application.yaml
+1
-1
No files found.
dao/src/main/resources/mapper/service/ServiceSubclassMapper.xml
View file @
c23105f2
...
@@ -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}
...
...
entity/src/main/java/com/onsiteservice/entity/category/ServiceSubclass.java
View file @
c23105f2
...
@@ -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
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/ServiceSubclassController.java
View file @
c23105f2
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
);
}
}
}
mini-app/src/main/java/com/onsiteservice/miniapp/controller/category/vo/ServiceSubclassVO.java
View file @
c23105f2
...
@@ -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
mini-app/src/main/java/com/onsiteservice/miniapp/service/category/ServiceSubclassService.java
View file @
c23105f2
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));
}*/
}*/
}
}
mini-app/src/main/resources/application.yaml
View file @
c23105f2
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment