发布一个k8s部署视频:https://edu.csdn.net/course/detail/26967
课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。
腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518
第二个视频发布 https://edu.csdn.net/course/detail/27109
腾讯课堂连接地址https://ke.qq.com/course/484107?tuin=ba64518
介绍主要的k8s资源的使用配置和命令。包括configmap,pod,service,replicaset,namespace,deployment,daemonset,ingress,pv,pvc,sc,role,rolebinding,clusterrole,clusterrolebinding,secret,serviceaccount,statefulset,job,cronjob,podDisruptionbudget,podSecurityPolicy,networkPolicy,resourceQuota,limitrange,endpoint,event,conponentstatus,node,apiservice,controllerRevision等。
第三个视频发布:https://edu.csdn.net/course/detail/27574
详细介绍helm命令,学习helm chart语法,编写helm chart。深入分析各项目源码,学习编写helm插件
————————————————------------------------------------------------------------------------------------------------------------------
1国际化资源文件
message.properties
#Custom
lang=zh_CN
ok=Ok
cancel=Cancel
system.name=Jollychic WMS
login.username=Username
login.password=Password
login.password.valid.text=Your password must between 6-20 characters.
login.button.text=Login
login.miss.username.text=Please enter your username.
message_zh_CN.properties
#Custom
lang=zh_CN
ok=确定
cancel=取消
system.name=执御WMS管理系统
login.username=用户名
login.password=密码
login.password.valid.text=密码必须是 6-20 个字符。
login.button.text=登录
login.miss.username.text=请输入用户名
login.change.language.text=语种
index.current.user=当前用户
2页面国际化切换
<span class="layout_north_user_language"> <g:message code="login.change.language.text"/>: </span>
<select name="lang" style="vertical-align: top; display: inline-block;" class="combobox" onChange="changeLanguage(this);">
<g:each in="${commons.ConstantValue.Languages}">
<option value="${it.key}" <g:if test="${params.lang == it.key}">selected="selected"</g:if>>${it.value}</option>
</g:each>
</select>
3session里放置国际化属性
def index() {
session.setAttribute(ConstantValue.SESSION_KEY_LANGUAGE, params.lang)
def user = UserUtils.currentUser
List<Long> ids = new ArrayList<Long>()
Application application = Application.findByAppKey(APPLICAITON_KEY);
if (user.roles.size() > 0) {
user.roles.each { role ->
role.menus.each { model ->
if (model.applicationId.intValue() == application.id.intValue()) {
ids.add(model.id)
}
}
}
}
def menus = Menu.findAllByParentIdAndIdInListAndType(0, ids, ConstantValue.MENU_TYPE_MODEL, [sort: "displayOrder", order: "asc"])
for (Menu menu : menus) {
menu.internationalMenuName = message(code: menu.getInternationalCodeByName())
}
render(view: 'index', model: [menus: menus])
}
4数据库字段内容国际化,比如菜单,根据语言选择菜单中英文名称
<div data-options="region:'west',split:true,headerCls:'panel-header-west',onCollapse:collapseWest" title="<g:message code="index.title.navigate"/>" style="width:200px;">
<div class="easyui-accordion" data-options="fit:true,border:false">
<g:each in="${menus}" >
<div title="<span class='menu-title-icon menu-title-icon${it.id}'></span> ${it.internationalMenuName}">
<ul class="easyui-tree" data-options="url:'getMenuData?parentId=${it.id}&lang=${params.lang}',
iconCls:'test',
onClick:function(node){
if(node.attributes){
Open(node.text,node.attributes.url);
}
}
"></ul>
</div>
</g:each>
</div>
</div>
5Controller层国际化转化
class BaseController {
protected proPageParams(params, page) {
Integer num = Integer.parseInt(params.rows)
page = page as Integer
params.max = Math.min(num, 200)
params.offset = page == 1 ? 0 : (page - 1) * num
}
protected String convertFileName(HttpServletRequest request, String fileName) {
String userAgent = request.getHeader("USER-AGENT");
String finalFileName = "";
try {
if (userAgent.contains("MSIE")) {//IE浏览器
finalFileName = URLEncoder.encode(fileName, "UTF8");
} else if (userAgent.contains("Mozilla")) {//google,火狐浏览器
finalFileName = new String(fileName.getBytes(), "ISO8859-1");
} else {
finalFileName = URLEncoder.encode(fileName, "UTF8");//其他浏览器
}
} catch (UnsupportedEncodingException e) {
log.error(e.getMessage());
}
return finalFileName;
}
public String message(String code, Object... args) {
return message(code: code, args: args) as String
}
}
继承BaseController,要转化的内容通过message方法转化
6Service类内容国际化
class BaseService {
private ApplicationTagLib taglib = new ApplicationTagLib()
public String message(String code, Object... args) {
return taglib.message(code: code, args: args) as String
}
}
继承BaseService要转化的内容通过message方法转化
7GSP页面国际化
例如:
<g:message code="index.title.navigate"/>
8报表国际化
我们用的是jasper report,把国际化后的变量通过参数传给报表就可以了