Skip to content

Commit

Permalink
translate.service 增加 translate.json 翻译日志的 referer
Browse files Browse the repository at this point in the history
收集,以方便再自助管理后台进行对自己网站的翻译记录日志的下载
  • Loading branch information
xnx3 committed Oct 21, 2023
1 parent cf03c87 commit 07fc7ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class TranslateSite implements java.io.Serializable{
private Integer id; //主键,自动编号
private String name; //站点名字,只是给自己看的,方便辨别
private String language; //当前语种,当前站点的语种是什么,如 english ,跟 http://api.translate.zvo.cn/doc/language.json.html 这里的值对应
private String url; //站点网址,格式如 http://www.zvo.cn 注意一定要带上前面的协议
private String url; //站点网址,格式如 www.zvo.cn
private Integer userid; //此条记录属于哪个用户,user.id

@Id
Expand All @@ -46,7 +46,7 @@ public String getLanguage() {
public void setLanguage(String language) {
this.language = language;
}
@Column(name = "url", columnDefinition="char(50) COMMENT '站点网址,格式如 http://www.zvo.cn 注意一定要带上前面的协议'")
@Column(name = "url", columnDefinition="char(50) COMMENT '站点网址,格式如 www.zvo.cn '")
public String getUrl() {
return url;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public TranslateResultVO translate(HttpServletRequest request,
params.put("time", DateUtil.currentDate("yyyy-MM-dd HH:mm:ss"));
params.put("method", "translate.json");
params.put("size", size);
params.put("referer", request.getHeader("referer"));

//先从缓存中取
String hash = null;
Expand Down

0 comments on commit 07fc7ac

Please sign in to comment.