|  |  | 
 |  |  | import com.doumee.core.model.ApiResponse; | 
 |  |  | import com.doumee.core.model.PageData; | 
 |  |  | import com.doumee.core.model.PageWrap; | 
 |  |  | import com.doumee.core.utils.Constants; | 
 |  |  | import com.doumee.dao.business.model.News; | 
 |  |  | import com.doumee.dao.web.reqeust.GenerateQRCodeRequest; | 
 |  |  | import com.doumee.dao.web.response.DailyUpdatesResponse; | 
 |  |  | import com.doumee.dao.web.response.ZSZXCatalogResponse; | 
 |  |  | import com.doumee.service.business.GetZhongTaiDataService; | 
 |  |  | import com.doumee.service.business.NewsService; | 
 |  |  | import com.doumee.service.business.SmsEmailService; | 
 |  |  | import com.doumee.service.business.UsersService; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | import io.swagger.annotations.ApiImplicitParam; | 
 |  |  | import io.swagger.annotations.ApiImplicitParams; | 
 |  |  | 
 |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import javax.imageio.ImageIO; | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | import java.io.InputStream; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * Created by IntelliJ IDEA. | 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     public GetZhongTaiDataService getZhongTaiDataService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     public UsersService usersService; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @UserLoginRequired | 
 |  |  |     @LoginRequired | 
 |  |  | 
 |  |  |     public ApiResponse<ZSZXCatalogResponse> getZSZXCatalogs() { | 
 |  |  |         return  ApiResponse.success(getZhongTaiDataService.getZSZXCatalogs(getMemberId(),getUserType())); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |             @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
 |  |  |     }) | 
 |  |  |     public ApiResponse<PageData<News>> newsPage (@RequestBody PageWrap<News> pageWrap) { | 
 |  |  |         pageWrap.getModel().setIsPublish(Constants.ONE); | 
 |  |  |         return ApiResponse.success(newsService.findPage(pageWrap)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     public ApiResponse<String> getCrmAuthUrl(@RequestParam Integer type) { | 
 |  |  |         return  ApiResponse.success(zbomCRMService.getCrmGoUrl(this.getLoginUserInfo().getIamUsername(),type)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "生成小程序码", notes = "PAD端") | 
 |  |  |     @PostMapping("/getQrCode") | 
 |  |  |     public void getQrCode(@RequestBody GenerateQRCodeRequest generateQRCodeRequest, HttpServletResponse response) { | 
 |  |  |         try{ | 
 |  |  |             response.setHeader("Cache-Control", "no-store, no-cache"); | 
 |  |  |             response.setContentType("image/jpeg"); | 
 |  |  |             InputStream inputStream = usersService.getQrCode(generateQRCodeRequest); | 
 |  |  |             ImageIO.write(ImageIO.read(inputStream),"png",response.getOutputStream()); | 
 |  |  |         }catch (Exception e){ | 
 |  |  |             e.printStackTrace(); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |