/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.cqcis.com</a>
 */
package com.crunii.micro.service.sysmgr.controller;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.service.sysmgr.dto.sysmgr.TestVo;
import com.crunii.micro.service.sysmgr.dto.sysmgr.WorkerInfo;
import com.crunii.micro.service.sysmgr.service.TestService;
import com.crunii.micro.service.sysmgr.service.WorkerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 田平 create 2023-02-20 06:18:30
 */
@Api(value = "员工相关测试")
@Slf4j
@RestController
@RequestMapping("/TestController")
public class TestController {
	@Autowired
	private WorkerService workerService;

	@Autowired
	private TestService testService;

	@GetMapping(path = "/getTsmWorker")
	@ResponseBody
	public Result<WorkerInfo> getTsmWorker(int loginId) {
		WorkerInfo worker = workerService.getWorkerInfo(loginId);
		Result<WorkerInfo> result = new Result<>();
		result.setData(worker);
		return result;
	}

	@ApiOperation(value = "测试静态值注入")
	@GetMapping(path = "/getTestInject")
	public Result<TestVo> testInject(){
		TestVo testVo = testService.testPropertyTranslate();
		return Result.ofSuccess(testVo);
	}

//	updateObsFile

	@ApiOperation(value = "updateObsFile")
	@GetMapping(path = "/updateObsFile")
	public Result<TestVo> updateObsFile(){
		testService.updateObsFile();
		return Result.ofSuccess();
	}

}
