Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e83742f8
authored
2026-01-13 18:00:34 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
15cd555c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
8 deletions
lego-admin/src/main/java/com/lego/web/controller/core/EntiretyController.java
lego-core/src/main/java/com/lego/core/service/IEntiretyService.java
lego-core/src/main/java/com/lego/core/service/impl/CourseServiceImpl.java
lego-core/src/main/java/com/lego/core/service/impl/EntiretyServiceImpl.java
lego-admin/src/main/java/com/lego/web/controller/core/EntiretyController.java
View file @
e83742f
...
...
@@ -87,4 +87,29 @@ public class EntiretyController extends BaseController {
public
R
<
Void
>
remove
(
@PathVariable
String
id
)
throws
ServerException
{
return
toAjax
(
service
.
remove
(
id
));
}
@RepeatSubmit
()
@PutMapping
(
"/display/{id}"
)
public
R
<
Void
>
display
(
@PathVariable
String
id
)
throws
ServerException
{
return
toAjax
(
service
.
display
(
id
));
}
@RepeatSubmit
()
@PutMapping
(
"/batch/display/{entiretyIds}"
)
public
R
<
Void
>
batchDisplay
(
@PathVariable
String
[]
entiretyIds
)
throws
ServerException
{
return
toAjax
(
service
.
batchDisplay
(
entiretyIds
));
}
@RepeatSubmit
()
@PutMapping
(
"/hide/{id}"
)
public
R
<
Void
>
hide
(
@PathVariable
String
id
)
throws
ServerException
{
return
toAjax
(
service
.
hide
(
id
));
}
@RepeatSubmit
()
@PutMapping
(
"/batch/hide/{entiretyIds}"
)
public
R
<
Void
>
batchHide
(
@PathVariable
String
[]
entiretyIds
)
throws
ServerException
{
return
toAjax
(
service
.
batchHide
(
entiretyIds
));
}
}
...
...
lego-core/src/main/java/com/lego/core/service/IEntiretyService.java
View file @
e83742f
...
...
@@ -79,4 +79,39 @@ public interface IEntiretyService {
* @return
*/
List
<
EntiretyVo
>
list
(
String
language
,
Collection
<
String
>
buildingBlockIds
);
/**
* 隐藏
*
* @param id
* @return
* @throws ServerException
*/
boolean
hide
(
String
id
)
throws
ServerException
;
/**
* 批量隐藏
*
* @param entiretyIds
* @return
* @throws ServerException
*/
boolean
batchHide
(
String
[]
entiretyIds
)
throws
ServerException
;
/**
* 显示
*
* @param id
* @return
* @throws ServerException
*/
boolean
display
(
String
id
)
throws
ServerException
;
/**
* 批量显示
*
* @param entiretyIds
* @return
* @throws ServerException
*/
boolean
batchDisplay
(
String
[]
entiretyIds
)
throws
ServerException
;
}
...
...
lego-core/src/main/java/com/lego/core/service/impl/CourseServiceImpl.java
View file @
e83742f
...
...
@@ -17,6 +17,7 @@ import com.lego.common.utils.StreamUtils;
import
com.lego.common.utils.StringUtils
;
import
com.lego.core.annotation.LanguageAnnotation
;
import
com.lego.core.domain.Course
;
import
com.lego.core.domain.Entirety
;
import
com.lego.core.domain.bo.CourseBo
;
import
com.lego.core.domain.bo.CourseQueryBo
;
import
com.lego.core.domain.vo.CourseVo
;
...
...
@@ -96,10 +97,10 @@ public class CourseServiceImpl implements ICourseService {
vo
.
setPptOssUrl
(
ossUrlService
.
selectUrlByIds
(
vo
.
getPptOssId
()));
}
if
(
vo
.
isVisible
()){
vo
.
setDisplay
(
"
已显示
"
);
vo
.
setDisplay
(
"
【已显示】
"
);
}
else
{
vo
.
setDisplay
(
"
已隐藏
"
);
vo
.
setDisplay
(
"
【已隐藏】
"
);
}
}
}
...
...
@@ -147,7 +148,7 @@ public class CourseServiceImpl implements ICourseService {
*/
@Override
public
List
<
CourseVo
>
list
()
{
List
<
CourseVo
>
list
=
baseMapper
.
selectVoList
(
null
);
List
<
CourseVo
>
list
=
baseMapper
.
selectVoList
(
Wrappers
.<
Course
>
lambdaQuery
().
eq
(
Course:
:
isVisible
,
true
)
);
for
(
CourseVo
vo
:
list
)
{
if
(
StrUtil
.
isNotBlank
(
vo
.
getTwoDimensionalOssId
())){
vo
.
setTwoDimensionalOssUrl
(
ossUrlService
.
selectUrlByIds
(
vo
.
getTwoDimensionalOssId
()));
...
...
@@ -306,10 +307,6 @@ public class CourseServiceImpl implements ICourseService {
@Override
public
boolean
batchDisplay
(
String
[]
courseIds
)
throws
ServerException
{
if
(
courseIds
==
null
)
System
.
out
.
println
(
"=============1=========="
);
else
System
.
out
.
println
(
"========================"
+
Arrays
.
asList
(
courseIds
));
for
(
String
id
:
courseIds
)
{
CourseVo
courseVo
=
baseMapper
.
selectVoById
(
id
);
courseVo
.
setVisible
(
true
);
...
...
lego-core/src/main/java/com/lego/core/service/impl/EntiretyServiceImpl.java
View file @
e83742f
...
...
@@ -16,6 +16,7 @@ import com.lego.core.domain.Course;
import
com.lego.core.domain.Entirety
;
import
com.lego.core.domain.bo.EntiretyBo
;
import
com.lego.core.domain.vo.BuildingBlockVo
;
import
com.lego.core.domain.vo.CourseVo
;
import
com.lego.core.domain.vo.EntiretyVo
;
import
com.lego.core.mapper.CourseMapper
;
import
com.lego.core.mapper.EntiretyMapper
;
...
...
@@ -93,7 +94,7 @@ public class EntiretyServiceImpl implements IEntiretyService {
*/
@Override
public
List
<
EntiretyVo
>
list
()
{
List
<
EntiretyVo
>
list
=
baseMapper
.
selectVoList
(
null
);
List
<
EntiretyVo
>
list
=
baseMapper
.
selectVoList
(
Wrappers
.<
Entirety
>
lambdaQuery
().
eq
(
Entirety:
:
isVisible
,
true
)
);
setInfo
(
list
);
return
list
;
}
...
...
@@ -188,6 +189,12 @@ public class EntiretyServiceImpl implements IEntiretyService {
if
(
StrUtil
.
isNotBlank
(
vo
.
getOssId
()))
{
vo
.
setOssUrl
(
ossUrlService
.
selectUrlByIds
(
vo
.
getOssId
()));
}
if
(
vo
.
isVisible
()){
vo
.
setDisplay
(
"【已显示】"
);
}
else
{
vo
.
setDisplay
(
"【已隐藏】"
);
}
}
}
}
...
...
@@ -203,4 +210,43 @@ public class EntiretyServiceImpl implements IEntiretyService {
throw
new
ServerException
(
MessageUtils
.
message
(
"core.data.exists"
));
}
}
@Override
public
boolean
display
(
String
id
)
throws
ServerException
{
EntiretyVo
entiretyVo
=
baseMapper
.
selectVoById
(
id
);
entiretyVo
.
setVisible
(
true
);
Entirety
entirety
=
BeanUtil
.
toBean
(
entiretyVo
,
Entirety
.
class
);
return
baseMapper
.
updateById
(
entirety
)
>
0
;
}
@Override
public
boolean
batchDisplay
(
String
[]
entiretyIds
)
throws
ServerException
{
for
(
String
id
:
entiretyIds
)
{
EntiretyVo
entiretyVo
=
baseMapper
.
selectVoById
(
id
);
entiretyVo
.
setVisible
(
true
);
Entirety
entirety
=
BeanUtil
.
toBean
(
entiretyVo
,
Entirety
.
class
);
baseMapper
.
updateById
(
entirety
);
}
return
true
;
}
@Override
public
boolean
hide
(
String
id
)
throws
ServerException
{
EntiretyVo
entiretyVo
=
baseMapper
.
selectVoById
(
id
);
entiretyVo
.
setVisible
(
false
);
Entirety
entirety
=
BeanUtil
.
toBean
(
entiretyVo
,
Entirety
.
class
);
return
baseMapper
.
updateById
(
entirety
)
>
0
;
}
@Override
public
boolean
batchHide
(
String
[]
entiretyIds
)
throws
ServerException
{
for
(
String
id
:
entiretyIds
)
{
EntiretyVo
entiretyVo
=
baseMapper
.
selectVoById
(
id
);
entiretyVo
.
setVisible
(
false
);
Entirety
entirety
=
BeanUtil
.
toBean
(
entiretyVo
,
Entirety
.
class
);
baseMapper
.
updateById
(
entirety
);
}
return
true
;
}
}
...
...
Write
Preview
Styling with
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