下载文件

dev
youhong.ai 2023-07-01 13:33:05 +08:00
parent 85c08ee18a
commit 0042972aa5
3 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,64 @@
package com.api.ebu7dev1.common.getlog.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
import com.api.ebu7dev1.common.getlog.service.GetLogService;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.log4j.Logger;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Map;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 10:27</p>
*
* @author youHong.ai
*/
@Path("/ebu7-dev1/common/log")
public class GetLogController {
private final Logger log = Util.getLogger();
private final GetLogService service = new GetLogService();
@GET
@Path("get")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response getLogger(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User loginUser = HrmUserVarify.getUser(request, response);
return service.get(loginUser);
} catch (Exception e) {
log.error("下载文件出错:" + Util.getErrString(e));
return Response.ok(ApiResult.error("system error!"), MediaType.APPLICATION_JSON).build();
}
}
@POST
@Path("collect")
@Produces(MediaType.APPLICATION_JSON)
public String collectLogInfo(@Context HttpServletRequest request,
@Context HttpServletResponse response,
@RequestBody Map<String, Object> params) {
try {
User loginUser = HrmUserVarify.getUser(request, response);
return service.collectLogInfo(loginUser, params);
} catch (Exception e) {
log.error("下载文件出错:" + Util.getErrString(e));
return ApiResult.error("system error!");
}
}
}

View File

@ -0,0 +1,30 @@
package com.api.ebu7dev1.common.getlog.service;
import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException;
import weaver.hrm.User;
import javax.ws.rs.core.Response;
import java.util.Map;
/**
* <h1></h1>
*
* <p>create: 2023/7/1 10:28</p>
*
* @author youHong.ai
*/
public class GetLogService {
public Response get(User loginUser) {
return null;
}
public String collectLogInfo(User loginUser, Map<String, Object> params) {
if (loginUser.getUID() != 1) {
throw new CustomerException("无权限查看!");
}
String startDate = Util.null2String(params.get("startDate"));
String endDate = Util.null2String(params.get("endDate"));
return null;
}
}

View File

@ -291,6 +291,25 @@ function loadJs(url, callback) {
} }
``` ```
ecode 多语言切换
```javascript
ecCom.WeaLocaleProvider.getLocaleLabelByCode(module).then(() => {//多语言获取成功,此处重绘页面
})
WeaverMobile.Tools.getLocaleLabel(module, () => {
console.log("请求成功")
})
// 移动端引入组件库多语言信息放在componentDidMount执行
WeaverMobile.Tools.getLocaleLabel("common", () => {
this.forceUpdate();
})
// 使用多语言
WeaverMobile.Tools.getLabel(i18nId, text)
```
### 数据库 ### 数据库
**备份mysql数据库** **备份mysql数据库**