|
@@ -272,8 +272,8 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
System.out.println("推文发布参数:" + JSON.toJSON(articleTweetDto));
|
|
System.out.println("推文发布参数:" + JSON.toJSON(articleTweetDto));
|
|
|
|
|
|
|
|
//查询当前用户
|
|
//查询当前用户
|
|
|
- AdminManager adminManager = adminManagerService.getById(articleTweetDto.getCreateId());
|
|
|
|
|
- if (adminManager == null) {
|
|
|
|
|
|
|
+ Users user = userService.queryByUserId(String.valueOf(articleTweetDto.getCreateId()));
|
|
|
|
|
+ if (user == null) {
|
|
|
jsonObject.put("code", 500);
|
|
jsonObject.put("code", 500);
|
|
|
jsonObject.put("message", "用户信息已失效,查看详情失败");
|
|
jsonObject.put("message", "用户信息已失效,查看详情失败");
|
|
|
jsonObject.put("data", null);
|
|
jsonObject.put("data", null);
|
|
@@ -303,8 +303,8 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
data.setStatus(1);
|
|
data.setStatus(1);
|
|
|
data.setPublishWay("管理端");
|
|
data.setPublishWay("管理端");
|
|
|
data.setIsTop(articleTweetDto.getIsTop());
|
|
data.setIsTop(articleTweetDto.getIsTop());
|
|
|
- data.setUserName(adminManager.getAdminName());
|
|
|
|
|
- data.setUserPhoto(ConstDefault.DefaultHeadPhoto);
|
|
|
|
|
|
|
+ data.setUserName(user.getUser_name());
|
|
|
|
|
+ data.setUserPhoto(user.getHeadPhoto() == null ? ConstDefault.DefaultHeadPhoto : user.getHeadPhoto());
|
|
|
int aId = articleTweetService.insert(data);
|
|
int aId = articleTweetService.insert(data);
|
|
|
if (aId <= 0) {
|
|
if (aId <= 0) {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
@@ -415,8 +415,8 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
System.out.println("推文发布参数:" + JSON.toJSON(articleTweetDto));
|
|
System.out.println("推文发布参数:" + JSON.toJSON(articleTweetDto));
|
|
|
|
|
|
|
|
//查询当前用户
|
|
//查询当前用户
|
|
|
- AdminManager adminManager = adminManagerService.getById(articleTweetDto.getCreateId());
|
|
|
|
|
- if (adminManager == null) {
|
|
|
|
|
|
|
+ Users user = userService.queryByUserId(String.valueOf(articleTweetDto.getCreateId()));
|
|
|
|
|
+ if (user == null) {
|
|
|
jsonObject.put("code", 500);
|
|
jsonObject.put("code", 500);
|
|
|
jsonObject.put("message", "用户信息已失效,查看详情失败");
|
|
jsonObject.put("message", "用户信息已失效,查看详情失败");
|
|
|
jsonObject.put("data", null);
|
|
jsonObject.put("data", null);
|
|
@@ -450,8 +450,8 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
data.setStatus(1);
|
|
data.setStatus(1);
|
|
|
data.setPublishWay("管理端");
|
|
data.setPublishWay("管理端");
|
|
|
data.setIsTop(articleTweetDto.getIsTop());
|
|
data.setIsTop(articleTweetDto.getIsTop());
|
|
|
- data.setUserName(adminManager.getAdminName());
|
|
|
|
|
- data.setUserPhoto(ConstDefault.DefaultHeadPhoto);
|
|
|
|
|
|
|
+ data.setUserName(user.getUser_name());
|
|
|
|
|
+ data.setUserPhoto(user.getHeadPhoto() == null ? ConstDefault.DefaultHeadPhoto : user.getHeadPhoto());
|
|
|
int aId = articleTweetService.update(data);
|
|
int aId = articleTweetService.update(data);
|
|
|
if (aId <= 0) {
|
|
if (aId <= 0) {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|