Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bbf7f4a2
authored
Jul 12, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础性的技能树列表返回,用于创建订单时候的条件选择
1 parent
9a762940
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
0 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/PublicController.java
project-order/src/main/java/com/dituhui/pea/order/dao/SkillInfoDao.java
project-order/src/main/java/com/dituhui/pea/order/dto/PublicSkillTreeDTO.java
project-order/src/main/java/com/dituhui/pea/order/service/PublicService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/PublicServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/controller/PublicController.java
View file @
bbf7f4a
...
...
@@ -27,4 +27,15 @@ public class PublicController {
}
return
res
;
}
@GetMapping
(
"/public/skill/tree"
)
public
Result
<?>
getPublicSkillTree
()
{
Result
<?>
res
=
null
;
try
{
res
=
publicService
.
getSkillTree
();
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
}
}
project-order/src/main/java/com/dituhui/pea/order/dao/SkillInfoDao.java
0 → 100644
View file @
bbf7f4a
package
com
.
dituhui
.
pea
.
order
.
dao
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
public
interface
SkillInfoDao
extends
JpaRepository
<
SkillInfoEntity
,
Long
>
{
List
<
SkillInfoEntity
>
getAll
();
}
project-order/src/main/java/com/dituhui/pea/order/dto/PublicSkillTreeDTO.java
0 → 100644
View file @
bbf7f4a
package
com
.
dituhui
.
pea
.
order
.
dto
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
public
class
PublicSkillTreeDTO
{
@Data
public
static
class
Result
{
private
List
<
Content
>
content
;
}
@Data
@Accessors
(
chain
=
true
)
public
static
class
Content
{
private
String
brand
;
private
String
skill
;
private
String
type
;
}
}
project-order/src/main/java/com/dituhui/pea/order/service/PublicService.java
View file @
bbf7f4a
...
...
@@ -4,4 +4,6 @@ import com.dituhui.pea.common.Result;
public
interface
PublicService
{
Result
<?>
getPublicParameter
();
Result
<?>
getSkillTree
();
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/PublicServiceImpl.java
View file @
bbf7f4a
...
...
@@ -2,8 +2,11 @@ package com.dituhui.pea.order.service.impl;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.dao.PubParamsDao
;
import
com.dituhui.pea.order.dao.SkillInfoDao
;
import
com.dituhui.pea.order.dto.PubParameterDTO
;
import
com.dituhui.pea.order.dto.PublicSkillTreeDTO
;
import
com.dituhui.pea.order.entity.PubParamsEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.service.PublicService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -12,6 +15,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
...
...
@@ -20,6 +24,9 @@ public class PublicServiceImpl implements PublicService {
@Autowired
private
PubParamsDao
pubParamsDao
;
@Autowired
private
SkillInfoDao
skillInfoDao
;
@Override
public
Result
<?>
getPublicParameter
()
{
List
<
PubParameterDTO
.
Enum
>
enums
=
new
ArrayList
<>();
...
...
@@ -42,6 +49,19 @@ public class PublicServiceImpl implements PublicService {
return
Result
.
success
(
rs
);
}
@Override
public
Result
<?>
getSkillTree
()
{
List
<
PublicSkillTreeDTO
.
Content
>
contents
=
skillInfoDao
.
getAll
().
stream
().
map
(
entity
->
{
return
new
PublicSkillTreeDTO
.
Content
()
.
setBrand
(
entity
.
getBrand
())
.
setType
(
entity
.
getType
())
.
setSkill
(
entity
.
getSkill
());
}).
collect
(
Collectors
.
toList
());
PublicSkillTreeDTO
.
Result
rs
=
new
PublicSkillTreeDTO
.
Result
();
rs
.
setContent
(
contents
);
return
Result
.
success
(
rs
);
}
private
HashMap
<
String
,
String
>
getMapping
()
{
String
[]
pairs
=
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment