Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
28c8555e
Commit
28c8555e
authored
Jan 30, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加主题缓存
parent
155702e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
2 deletions
+45
-2
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteThemeController.java
.../com/mortals/xhx/module/site/web/SiteThemeController.java
+44
-1
base-manager/src/test/java/com/mortals/httpclient/site/SiteController.http
...test/java/com/mortals/httpclient/site/SiteController.http
+1
-1
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteThemeController.java
View file @
28c8555e
package
com.mortals.xhx.module.site.web
;
package
com.mortals.xhx.module.site.web
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.key.RedisKey
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.module.site.model.SiteQuery
;
import
com.mortals.xhx.module.window.model.WindowBusinessEntity
;
import
org.apache.ibatis.cache.CacheKey
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -36,7 +47,7 @@ import static com.mortals.framework.ap.SysConstains.*;
...
@@ -36,7 +47,7 @@ import static com.mortals.framework.ap.SysConstains.*;
public
class
SiteThemeController
extends
BaseCRUDJsonBodyMappingController
<
SiteThemeService
,
SiteThemeEntity
,
Long
>
{
public
class
SiteThemeController
extends
BaseCRUDJsonBodyMappingController
<
SiteThemeService
,
SiteThemeEntity
,
Long
>
{
@Autowired
@Autowired
private
ParamService
param
Service
;
private
ICacheService
cache
Service
;
public
SiteThemeController
(){
public
SiteThemeController
(){
super
.
setModuleDesc
(
"主题"
);
super
.
setModuleDesc
(
"主题"
);
...
@@ -48,4 +59,36 @@ public class SiteThemeController extends BaseCRUDJsonBodyMappingController<SiteT
...
@@ -48,4 +59,36 @@ public class SiteThemeController extends BaseCRUDJsonBodyMappingController<SiteT
}
}
/**
* 根据站点id获取当前站点主题
*/
@PostMapping
(
value
=
"site"
)
@UnAuth
public
String
getThemeCacheBySite
(
@RequestBody
SiteThemeEntity
site
)
{
JSONObject
jsonObject
=
new
JSONObject
();
String
busiDesc
=
"根据站点id获取当前站点主题列表"
+
this
.
getModuleDesc
();
try
{
if
(
ObjectUtils
.
isEmpty
(
site
.
getSiteId
()))
throw
new
AppException
(
"站点id不能为空!"
);
if
(
ObjectUtils
.
isEmpty
(
site
.
getUserType
()))
throw
new
AppException
(
"服务类型不能为空!"
);
String
jsonstr
=
cacheService
.
hget
(
RedisCacheKeys
.
getSiteUserTypeThemeCodeKey
()
+
site
.
getSiteId
(),
site
.
getUserType
(),
String
.
class
);
List
<
SiteThemeEntity
>
siteThemeEntities
=
JSON
.
parseObject
(
jsonstr
,
new
TypeReference
<
List
<
SiteThemeEntity
>>()
{
});
jsonObject
.
put
(
KEY_RESULT_DATA
,
siteThemeEntities
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
"根据站点id获取当前站点主题列表成功!"
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取异常"
,
e
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
}
return
jsonObject
.
toJSONString
();
}
}
}
\ No newline at end of file
base-manager/src/test/java/com/mortals/httpclient/site/SiteController.http
View file @
28c8555e
...
@@ -115,7 +115,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId
...
@@ -115,7 +115,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId
Content-Type: application/json
Content-Type: application/json
{
{
"id":2
3
"id":2
4
}
}
...
...
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