SearchLogsController.java 1.05 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
package com.lyms.talkonlineweb.controller;

import com.lyms.talkonlineweb.domain.LymsSearchlogs;
import com.lyms.talkonlineweb.result.BaseResponse;
import com.lyms.talkonlineweb.service.LymsSearchlogsService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Log4j2
@RestController
@RequestMapping("searchlogs")
public class SearchLogsController {
@Autowired
private LymsSearchlogsService lymsSearchlogsService;

/**
* 小程序用户端保存搜索记录
* @param lymsSearchlogs
* @return
*/
@PostMapping("saveSearchlogs")
public BaseResponse saveSearchlogs(@RequestBody LymsSearchlogs lymsSearchlogs){
BaseResponse baseResponse=new BaseResponse();
try {
lymsSearchlogsService.save(lymsSearchlogs);
baseResponse.setErrormsg("成功");
} catch (Exception e) {
baseResponse.setErrormsg("失败");
e.printStackTrace();
}
return baseResponse;
}
}