zouxuan 5 anni fa
parent
commit
7e40399778

+ 8 - 13
cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

@@ -1,23 +1,17 @@
 package com.ym.mec.cms.controller;
 
+import com.ym.mec.cms.controller.queryinfo.NewsInformationQueryInfo;
+import com.ym.mec.cms.dal.entity.SysNewsInformation;
+import com.ym.mec.cms.service.SysNewsInformationService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.Date;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
-import com.ym.mec.cms.controller.queryinfo.NewsInformationQueryInfo;
-import com.ym.mec.cms.dal.entity.SysNewsInformation;
-import com.ym.mec.cms.service.SysNewsInformationService;
-import com.ym.mec.common.controller.BaseController;
+import java.util.Date;
 
 @RestController
 @RequestMapping("news")
@@ -35,7 +29,8 @@ public class NewsController extends BaseController {
 
 	@ApiOperation("查询资讯详情")
 	@ApiImplicitParam(name = "id", value = "资讯ID编号", required = true, dataType = "Long", paramType = "path")
-	@GetMapping(value = "/query/{id}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@GetMapping(value = "/query/{id}",
+			consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	public Object query(@PathVariable("id") Long id) {
 
 		return succeed(sysNewsInformationService.get(id));

+ 8 - 8
mec-im/src/main/java/com/ym/controller/UserController.java

@@ -22,14 +22,14 @@ public class UserController {
     @Autowired
     UserService userService;
 
-    @RequestMapping(value = "/refresh-token", method = RequestMethod.POST)
-    public Object refreshToken(@RequestBody ReqUserData reqUserData)
-            throws ApiException, Exception {
-        String token = userService.refreshToken(reqUserData.getUserId(), reqUserData.getUserId());
-        BaseResponse<String> response = new BaseResponse<>();
-        response.setData(token);
-        return response;
-    }
+//    @RequestMapping(value = "/refresh-token", method = RequestMethod.POST)
+//    public Object refreshToken(@RequestBody ReqUserData reqUserData)
+//            throws ApiException, Exception {
+//        String token = userService.refreshToken(reqUserData.getUserId(), reqUserData.getUserId());
+//        BaseResponse<String> response = new BaseResponse<>();
+//        response.setData(token);
+//        return response;
+//    }
 
     @RequestMapping(value = "/register", method = RequestMethod.POST)
     public Object register(@RequestBody UserModel userModel) throws Exception {

+ 10 - 10
mec-im/src/main/java/com/ym/service/Impl/UserServiceImpl.java

@@ -42,16 +42,16 @@ public class UserServiceImpl implements UserService {
     @Autowired
     IMHelper imHelper;
 
-    @Override
-    public String refreshToken(String userId, String name) throws ApiException, Exception  {
-        log.info("request token: {}, {}", userId, name);
-        IMTokenInfo tokenInfo = imHelper.getToken(userId, name, "");
-        if (tokenInfo.isSuccess()) {
-            return tokenInfo.getAuthenticationValue();
-        } else {
-            throw new ApiException(ErrorEnum.ERR_IM_TOKEN_ERROR, tokenInfo.getErrorMessage());
-        }
-    }
+//    @Override
+//    public String refreshToken(String userId, String name) throws ApiException, Exception  {
+//        log.info("request token: {}, {}", userId, name);
+//        IMTokenInfo tokenInfo = imHelper.getToken(userId, name, "");
+//        if (tokenInfo.isSuccess()) {
+//            return tokenInfo.getAuthenticationValue();
+//        } else {
+//            throw new ApiException(ErrorEnum.ERR_IM_TOKEN_ERROR, tokenInfo.getErrorMessage());
+//        }
+//    }
 
     private User getUser(){
         RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret);

+ 1 - 1
mec-im/src/main/java/com/ym/service/UserService.java

@@ -15,7 +15,7 @@ import io.rong.models.user.UserModel;
  */
 public interface UserService {
 
-    public String refreshToken(String userId, String name) throws ApiException, Exception;
+//    public String refreshToken(String userId, String name) throws ApiException, Exception;
 
     //用户
     TokenResult register(UserModel userModel) throws Exception;