Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
appApi
Overview
Overview
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
antaile
appApi
Commits
f3b4a37b
Commit
f3b4a37b
authored
Aug 03, 2021
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
云应用相关的业务代码
parent
29da8e58
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
5 deletions
+80
-5
DeleteAtlTimeArticleParam.java
...studio/antaile/InsertParam/DeleteAtlTimeArticleParam.java
+21
-0
AtlTimeController.java
...va/com/hwstudio/antaile/controller/AtlTimeController.java
+12
-2
AtlTimeArticleServie.java
...va/com/hwstudio/antaile/service/AtlTimeArticleServie.java
+38
-1
AtlTimeService.java
...ain/java/com/hwstudio/antaile/service/AtlTimeService.java
+2
-0
AtlTimeArticleMapper.xml
src/main/resources/mapping/AtlTimeArticleMapper.xml
+7
-2
No files found.
src/main/java/com/hwstudio/antaile/InsertParam/DeleteAtlTimeArticleParam.java
0 → 100644
View file @
f3b4a37b
package
com
.
hwstudio
.
antaile
.
InsertParam
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author xh
* @Date 2021/7/30
* description:
*/
@Data
public
class
DeleteAtlTimeArticleParam
implements
Serializable
{
@ApiModelProperty
(
value
=
"标签"
)
private
String
label
;
@ApiModelProperty
(
value
=
"用户Id"
)
private
Long
userId
;
}
src/main/java/com/hwstudio/antaile/controller/AtlTimeController.java
View file @
f3b4a37b
package
com
.
hwstudio
.
antaile
.
controller
;
import
com.hwstudio.antaile.InsertParam.DeleteAtlTimeArticleParam
;
import
com.hwstudio.antaile.dto.*
;
import
com.hwstudio.antaile.entity.AtlTime
;
import
com.hwstudio.antaile.entity.AtlUser
;
...
...
@@ -124,13 +125,13 @@ public class AtlTimeController extends BaseController {
@RequestMapping
(
value
=
"/addTimeTwo"
)
@ApiOperation
(
value
=
"新增时光纪"
,
httpMethod
=
"POST"
,
notes
=
"新增时光纪"
)
@ApiResponses
(
@ApiResponse
(
code
=
200
,
message
=
"请求成功"
,
response
=
JsonResult
.
class
))
public
JsonResult
addTimeTwo
(
AtlTimeVo
atlTimeVo
)
{
public
JsonResult
addTimeTwo
(
@ApiParam
(
value
=
"传入对象"
)
@RequestBody
AtlTimeVo
atlTimeVo
)
{
Long
userId
=
super
.
getUserId
();
if
(
userId
==
null
)
{
return
JsonResult
.
notLogin
();
}
AtlTime
atlTime
=
atlTimeService
.
addTime
Two
(
atlTimeVo
,
userId
);
AtlTime
atlTime
=
atlTimeService
.
addTime
(
atlTimeVo
,
userId
);
return
JsonResult
.
success
(
"新增时光纪成功"
,
atlTime
);
}
...
...
@@ -610,4 +611,13 @@ public class AtlTimeController extends BaseController {
return
JsonResult
.
success
(
"操作成功"
,
this
.
atlTimeService
.
selectTimeUserIdByTimeId
(
timeId
));
}
@ApiOperation
(
"根据用户id和标签名 删除相关标签名"
)
@RequestMapping
(
value
=
"/deleteByLabelAndUserId"
,
method
=
RequestMethod
.
POST
)
public
JsonResult
deleteByLabelAndUserId
(
@ApiParam
(
value
=
"传入对象"
)
@RequestBody
DeleteAtlTimeArticleParam
deleteAtlTimeArticleParam
)
{
AtlUser
atlUser
=
super
.
getHeadToken
();
if
(
atlUser
==
null
)
{
return
JsonResult
.
notLogin
();
}
return
this
.
atlTimeArticleServie
.
deleteByLabelAndUserId
(
deleteAtlTimeArticleParam
.
getLabel
(),
deleteAtlTimeArticleParam
.
getUserId
());
}
}
src/main/java/com/hwstudio/antaile/service/AtlTimeArticleServie.java
View file @
f3b4a37b
...
...
@@ -10,6 +10,10 @@ import com.hwstudio.antaile.entity.AtlTimeArticle;
import
com.hwstudio.antaile.entity.AtlTimeArticleFile
;
import
com.hwstudio.antaile.entity.AtlTimeArticleImage
;
import
com.hwstudio.antaile.mapper.*
;
import
com.hwstudio.antaile.mbg.mapper.SysAtlTimeArticleMapper
;
import
com.hwstudio.antaile.mbg.po.SysAtlTimeArticle
;
import
com.hwstudio.antaile.mbg.po.SysAtlTimeArticleExample
;
import
com.hwstudio.antaile.utils.JsonResult
;
import
com.hwstudio.antaile.vo.AtlTimeArticleFileVo
;
import
com.vdurmont.emoji.EmojiParser
;
import
net.sf.json.JSONArray
;
...
...
@@ -49,7 +53,8 @@ public class AtlTimeArticleServie {
private
AtlTimeMessageMapper
atlTimeMessageMapper
;
@Resource
private
DictMapper
dictMapper
;
@Resource
private
SysAtlTimeArticleMapper
sysAtlTimeArticleMapper
;
private
EmojiConverter
emojiConverter
=
EmojiConverter
.
getInstance
();
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -696,4 +701,36 @@ public class AtlTimeArticleServie {
return
list
;
}
/**
* 根据用户id和标签模糊查询 删除标签
*
* @param label
* @param userId
* @return
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
JsonResult
deleteByLabelAndUserId
(
String
label
,
Long
userId
)
{
if
(
label
==
null
||
label
.
isEmpty
())
{
return
JsonResult
.
failed
(
"传入标签为空!"
);
}
else
{
boolean
flag
=
label
.
contains
(
","
);
if
(!
flag
)
{
label
=
label
+
","
;
}
}
if
(
userId
==
null
)
{
return
JsonResult
.
failed
(
"传入用户id为空"
);
}
SysAtlTimeArticleExample
example
=
new
SysAtlTimeArticleExample
();
SysAtlTimeArticleExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andLabelLike
(
"%"
+
label
+
"%"
);
criteria
.
andUserIdEqualTo
(
userId
);
List
<
SysAtlTimeArticle
>
sysAtlTimeArticleList
=
this
.
sysAtlTimeArticleMapper
.
selectByExample
(
example
);
for
(
SysAtlTimeArticle
item
:
sysAtlTimeArticleList
)
{
item
.
setLabel
(
item
.
getLabel
().
replace
(
label
,
""
));
this
.
sysAtlTimeArticleMapper
.
updateByPrimaryKeySelective
(
item
);
}
return
JsonResult
.
success
(
"删除相关标签成功"
);
}
}
src/main/java/com/hwstudio/antaile/service/AtlTimeService.java
View file @
f3b4a37b
...
...
@@ -111,6 +111,8 @@ public class AtlTimeService {
atlTimeOwnerMapper
.
insert
(
atlTimeOwner
);
}
else
{
atlTimeVo
.
getSysAtlTimeOwner
().
setTimeId
(
atlTime
.
getId
());
atlTimeVo
.
getSysAtlTimeOwner
().
setCreateDate
(
new
Date
());
atlTimeVo
.
getSysAtlTimeOwner
().
setLastUpdateDate
(
new
Date
());
sysAtlTimeOwnerMapper
.
insertSelective
(
atlTimeVo
.
getSysAtlTimeOwner
());
}
...
...
src/main/resources/mapping/AtlTimeArticleMapper.xml
View file @
f3b4a37b
...
...
@@ -109,8 +109,13 @@
</select>
<select
id=
"getH5ArticelList"
resultType=
"java.util.Map"
>
SELECT id, title, type, content, date_format(create_date, '%Y-%m-%d %H:%i:%s') AS createDate, date_format(occur_time, '%Y-%m-%d') AS occurTime
FROM atl_time_article WHERE time_id = #{timeId} and type = #{type} AND del_flag = '0' and privacy_setting != 2 ORDER BY occur_time ASC
SELECT a.id, a.title, a.type, a.content, date_format(a.create_date, '%Y-%m-%d %H:%i:%s') AS createDate, date_format(a.occur_time, '%Y-%m-%d') AS occurTime
FROM atl_time_article a
WHERE a.time_id = #{timeId}
and a.type = #{type}
AND a.del_flag = '0'
and a.privacy_setting != 2
ORDER BY a.occur_time ASC
</select>
<select
id=
"getDetails"
resultType=
"java.util.Map"
>
...
...
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