首页 文章 精选 留言 我的

精选列表

搜索[Java应用],共10000篇文章
优秀的个人博客,低调大师

华为鸿蒙OS 尝鲜 (二)创建TV(JS)应用

1. 选择TV设备 列表模板(JS版本) ![] 2. 生成后JS版本部分如下: index.css 样式控制和平常css没啥两样 .container { flex-direction: row; justify-content: flex-start; align-items: flex-start; background-color: #000000; } .title { line-height: 60px; font-size: 48px; margin-bottom: 16px; color: #ffffff; margin-left: 48px; } .content_box { flex-direction: column; justify-content: flex-start; align-items: flex-start; width: 516px; margin-top: 24px; } .content-list { width: 516px; flex-direction: column; justify-content: flex-start; align-items: flex-start; flex-grow: 1; } .content-bar { flex-direction: row; justify-content: space-between; align-items: center; width: 420px; height: 48px; margin-left: 48px; margin-right: 48px; background-color: #808080; border-radius: 8px; } .content-bar-focus { flex-direction: row; justify-content: space-between; align-items: center; width: 420px; height: 48px; margin-left: 48px; margin-right: 48px; background-color: #ffffff; border-radius: 8px; } .bar-title { color: #ffffff; font-size: 24px; margin-left: 15px; } .bar-title-focus { color: #000000; font-size: 24px; margin-left: 15px; } .bar-more { flex-direction: row; justify-content: space-between; align-items: center; margin-right: 15px; width: 30px; height: 24px; } .bar-img { object-fit: contain; } .content_img { width: 444px; flex-direction: column; justify-content: flex-start; align-items: flex-end; } .img-box { margin-top: 160px; margin-right: 160px; background-color: #808080; width: 198px; height: 198px; } .img-img { object-fit: contain; width: 198px; height: 198px; } .text_box { width: 272px; justify-content: center; margin-right: 123px; margin-top: 12px; } .img-text { font-size: 24px; color: #ffffff; } index.hml 模板文件 <div class="container"> <div class="content_box"> <text class="title">{{Title}} </text> <list class="content-list"> <list-item type="listItem" class="{{list_item_class1}}" onfocus="focusFunc1" onblur="blurFunc1"> <text class="{{text_class1}}">{{$t('strings.list')}} 1 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class2}}" onfocus="focusFunc2" onblur="blurFunc2"> <text class="{{text_class2}}">{{$t('strings.list')}} 2 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class3}}" onfocus="focusFunc3" onblur="blurFunc3"> <text class="{{text_class3}}">{{$t('strings.list')}} 3 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class4}}" onfocus="focusFunc4" onblur="blurFunc4"> <text class="{{text_class4}}">{{$t('strings.list')}} 4 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class5}}" onfocus="focusFunc5" onblur="blurFunc5"> <text class="{{text_class5}}">{{$t('strings.list')}} 5 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> <list-item type="divider" style="height: 12px"></list-item> <list-item type="listItem" class="{{list_item_class6}}" onfocus="focusFunc6" onblur="blurFunc6"> <text class="{{text_class6}}">{{$t('strings.list')}} 6 </text> <div class="bar-more"> <image class="bar-img" src="../../common/arrow.png"></image> </div> </list-item> </list> </div> <div class="content_img"> <div class="img-box"> <image class="img-img" src=""></image> </div> <div class="text_box"> <text class="img-text">{{$t('strings.img-text')}} </text> </div> </div> </div> index.js 脚本控制部分 export default { data: { Title: "", list_item_class1: "content-bar", text_class1: "bar-title", list_item_class2: "content-bar", text_class2: "bar-title", list_item_class3: "content-bar", text_class3: "bar-title", list_item_class4: "content-bar", text_class4: "bar-title", list_item_class5: "content-bar", text_class5: "bar-title", list_item_class6: "content-bar", text_class6: "bar-title", }, onInit (){ this.Title = this.$t('strings.title'); }, /* activated when the component has focus */ focusFunc1: function () { this.list_item_class1 = "content-bar-focus"; this.text_class1 = "bar-title-focus"; }, /* activated when the component loses focus */ blurFunc1: function () { this.list_item_class1 = "content-bar"; this.text_class1 = "bar-title"; }, focusFunc2: function () { this.list_item_class2 = "content-bar-focus"; this.text_class2 = "bar-title-focus"; }, blurFunc2: function () { this.list_item_class2 = "content-bar"; this.text_class2 = "bar-title"; }, focusFunc3: function () { this.list_item_class3 = "content-bar-focus"; this.text_class3 = "bar-title-focus"; }, blurFunc3: function () { this.list_item_class3 = "content-bar"; this.text_class3 = "bar-title"; }, focusFunc4: function () { this.list_item_class4 = "content-bar-focus"; this.text_class4 = "bar-title-focus"; }, blurFunc4: function () { this.list_item_class4 = "content-bar"; this.text_class4 = "bar-title"; }, focusFunc5: function () { this.list_item_class5 = "content-bar-focus"; this.text_class5 = "bar-title-focus"; }, blurFunc5: function () { this.list_item_class5 = "content-bar"; this.text_class5 = "bar-title"; }, focusFunc6: function () { this.list_item_class6 = "content-bar-focus"; this.text_class6 = "bar-title-focus"; }, blurFunc6: function () { this.list_item_class6 = "content-bar"; this.text_class6 = "bar-title"; } } 国际化(i18n)的支持: 从观看直播华为应该是对这块很重视帮助开发者“走出去”。 zh-CN.json { "strings":{ "title":"标题", "list": "栏目", "img-text":"显示图片" }, "Files":{ } } en-US.json { "strings":{ "title":"Title", "list": "List", "img-text":"Display Image" }, "Files":{ } } 3. 结尾 运行看效果: 这个和混合APP开发没啥太大区别(可能API,个别语法稍微不太一样)前端开发者应该能很快上手。

优秀的个人博客,低调大师

GoFrame v1.13.1 发布,Go 应用开发框架

哈罗,各位gfer久等啦,时隔两个月,新版本又来咯!! GoFrame GF(Go Frame)是一款模块化、高性能、生产级的Go基础开发框架。实现了比较完善的基础设施建设以及开发工具链,提供了常用的基础开发模块,如:缓存、日志、队列、数组、集合、容器、定时器、命令行、内存锁、对象池、配置管理、资源管理、数据校验、数据编码、定时任务、数据库ORM、TCP/UDP组件、进程管理/通信等等。并提供了Web服务开发的系列核心组件,如:Router、Cookie、Session、Middleware、服务注册、模板引擎等等,支持热重启、热更新、域名绑定、TLS/HTTPS、Rewrite等特性。 特点 模块化、松耦合设计; 模块丰富、开箱即用; 简便易用、易于维护; 高代码质量、高单元测试覆盖率; 社区活跃,大牛谦逊低调脾气好; 详尽的开发文档及示例; 完善的本地中文化支持; 设计为团队及企业使用; 发展 GoFrame开始得比较早,2011年始于北京一个智能物联网平台项目,那时还没有这么多物联网的现行标准,Go的标准库以及生态也未如此丰富。2017年的时候GF才开始发布测试版,2018年1024程序员节日的时候才发布v1.0正式版,为Go生态发展添砖加瓦。开源以来快速迭代、发展成长,广受开发者和企业的青睐,也有许多的开发者加入了贡献行列。GF原本是为开发团队设计的,因此她的开发效率和可维护性做得非常好,有着很高的代码质量以及丰富的单元测试和示例,并且GF是目前中文化文档做的最好的Golang开发框架。 Change Log 应多数开发者的要求,框架要求的最低Golang运行版本降级为了v1.11。 新增GoFrame视频教程地址: bilibili:https://www.bilibili.com/video/av94410029 西瓜视频:https://www.ixigua.com/pseries/6809291194665796100/ 将不常用的guuid模块迁移到 github.com/gogf/guuid 作为社区模块维护,保持gf主仓库的轻量级。 新增guid模块,用于高效轻量级的唯一字符串生成:https://goframe.org/util/guid/index tool chain 工具链更新:https://goframe.org/toolchain/cli 新增gf env命令,更优雅地查看当前Golang环境变量信息。 新增gf mod path命令,用于将当前go modules包拷贝到GOPATH中,以便使用原始的GOPATH方式开发项目。 对现有cli命令进行了一些改进,提高使用体验;预编译二进制版本在部分平台下提供了upx压缩,使得下载的文件更小。 container garray https://goframe.org/container/garray/index 简化数组使用方式,支持类似于var garray.Array的变量定义使用方式; 增加Walk方法,用于自定义的数组元素处理方法; 增加ContainsI方法,用于大小写忽略匹配的数组元素项存在性查找; 完善单元测试,代码覆盖率94%; 代码改进,提高性能; 修复一些问题; gchan 由于该封装包实际意义不是很大,因此从主框架中删除; glist https://goframe.org/container/glist/index 简化链表使用方式,支持类似于var glist.List的变量定义使用方式; 完善单元测试,代码覆盖率99%; gmap https://goframe.org/container/gmap/index 简化Map使用方式,支持类似于var gmap.Map的变量定义使用方式; 完善单元测试,代码覆盖率81%; 代码改进,提高性能; gset https://goframe.org/container/gset/index 简化集合使用方式,支持类似于var gset.Set的变量定义使用方式; 增加Walk方法,用于自定义的集合元素处理方法; 完善单元测试,代码覆盖率90%; 代码改进,提高性能; gtree https://goframe.org/container/gtree/index 简化树型使用方式,支持类似于var gtree.BTree的变量定义使用方式; 完善单元测试,代码覆盖率90%; gvar https://goframe.org/container/gvar/index 完善单元测试,代码覆盖率69%; 代码组织结构调整,提高维护性; 代码改进,提高性能; database gdb 增加Transaction(f func(tx *TX) error) (err error)接口方法,用于通过闭包实现事务封装处理:https://goframe.org/database/gdb/transaction 去掉不常用的From接口方法,改进Table及Model方法的参数为不定参数,并支持通过不定参数传递表别名:https://goframe.org/database/gdb/chaining/select 增加DryRun特性,支持空跑时只执行查询不执行写入/更新/删除操作:https://goframe.org/database/gdb/senior 增加create_at,update_at写入时间、更新时间字段自动填充特性:https://goframe.org/database/gdb/chaining/auto-time 增加delete_at软删除特性:https://goframe.org/database/gdb/chaining/auto-time 增加Having链式操作方法,用于having条件查询:https://goframe.org/database/gdb/chaining/select Result结果对象增加Chunk方法,用于自定义的数据分批处理:https://goframe.org/database/gdb/result 改进Schema数据库运行时切换特性; 改进对pgsql,mssql,sqlite,oracle数据库字段类型的支持; 进一步完善单元测试; 代码组织结构调整,提高维护性; 代码改进,提高性能; gredis 增加MaxActive连接池参数默认配置为100,限制默认的连接数量; 改进Conn连接对象的Do方法,支持对map/slice/struct类型进行自动的json.Marshal处理,注意获取数据时使用DoVar方法获取:https://goframe.org/database/gredis/usage 完善单元测试,代码覆盖率72%; net ghttp 增加Prefix及Retry客户端链式操作方法; 增加客户端原始请求打印特性:https://goframe.org/net/ghttp/client/demo/dump 增加ClientMaxBodySize的服务端配置,用于限制客户端提交的Body大小,默认为8MB;在涉及到上传的Server中需要增加该配置的大小,在配置文件中指定对应的大小即可,如ClientMaxBodySize="100MB":https://goframe.org/net/ghttp/config 改进SessionId生成的随机性,提高Session安全性:https://goframe.org/os/gsession/index 改进ghttp.Server实现了标准库的http.Handler接口,便于与其他第三方的服务如Prometheus进行代码集成; 其他大量的代码细节改进工作,提高性能及持久维护性; 完善单元测试,代码覆盖率61%; gipv4 增加GetIpArray方法,用于获取当前主机的所有IPv4地址; 增加GetMacArray及GetMac方法,用于获取当前主机的MAC地址信息; 修改IntranetIP方法名称为GetIntranetIp,修改IntranetIPArray方法名称为GetIntranetIpArray; encoding gjson 新增GetMaps获取JSON内部节点变量方法; 改进NewWithTag方法对map/struct的处理; 完善单元测试,代码覆盖率77%; gyaml 升级依赖的第三方yaml解析包,解决了map[interface{}]interface{}转换问题; error gerror 新增NewfSkip方法,用于创建skip指定堆栈的错误对象; 放开框架所有的堆栈链路打印,展示错误时真实的链路调用详情; os gcache 增加GetVar方法,用于获得可以便捷转换为其他数据类型的"泛型"变量; 标记Removes方法废弃,改进Remove方法参数为不定参数,统一使用Remove方法删除单个/多个键值对; 完善单元测试,代码覆盖率96%; genv 增加GetVar方法,用于获得可以便捷转换为其他数据类型的"泛型"变量; gfile 改进CopyDir/CopyFile复制目录/文件方法; 新增ScanDirFunc方法,用于支持自定义处理回调的目录检索; 完善单元测试,代码覆盖率64%; glog 增加支持Context上下文变量的日志打印特性:https://goframe.org/os/glog/context gres 改进打包特性,增强生成二进制文件及Go文件的压缩比,比旧版本增加20%压缩率,使得编译生成的二进制文件体积更小; 代码结构改进,提高执行效率及可持久维护性; gsession 改进SessionId默认生成方法,采用guid.S方法生成; 增加SetId及SetIdFunc方法,用于自定义SessionId及自定义的SessionId生成方法; frame g 新增g.Table方法,用于快速创建数据库模型操作对象; i18n gi18n 新增GetContent方法,用于获取指定i18n关键字为转译内容; 改进代码细节,提高性能和持久可维护性; 完善单元测试,代码覆盖率74%; test gtest 增加AssertNQ断言方法,用于强类型的不相等判断; text gstr 增加SubStrRune方法,用于支持unicode的字符串截取; 增加StrLimitRune方法,用于支持unicode的字符串截断隐藏; 增加LenRune方法,用于替换RuneLen方法,统一方法命名风格; 增加PosRune/PosIRune/PosRRune/PosRIRune方法,用于支持unicode的字符串左右位置查找; 增加CompareVersionGo方法,用于Golang风格的版本号大小比较; 完善单元测试,代码覆盖率75%; util gconv 改进Convert转换方法,支持常见map类型的转换; 改进类型转换过程中异常错误的捕获,通过error返回; 其他一些细节改进; 完善单元测试,代码覆盖率63%; grand 增加B方法,用于获得随机的二进制数据; 改进代码底层实现,部分接口性能提高50%; 完善单元测试,代码覆盖率74%; guid 新增guid模块,用于高效轻量级的唯一字符串生成:https://goframe.org/util/guid/index gutil 增加MapContains方法,用于判断map中是否包含指定键名; 增加MapDelete方法,用于删除map中指定的键名,可以为多个键名; 增加MapMerge方法,用于合并两个map; 增加MapMergeCopy方法,用于拷贝多个map; 增加MapContainsPossibleKey方法,用于查找指定键名,忽略大小写及字符'-'/'_'/'.'/' '; gvalid 所有默认的错误提示改为了英文; 错误提示的配置改为了通过i18n来配置实现,以便支持国际化:https://goframe.org/util/gvalid/message 身份证号规则名称从id-number改为了resident-id; 银行卡号规则名称从luhn改为了bank-card; 完善单元测试,代码覆盖率96%; Bug Fix 修复gcompress的多文件zip压缩问题; 修复ghttp.Client获取返回的过期Cookie的问题; 修复gres.File对于http.File接口的实现细节; 修复garray.Pop*方法的边界问题; 修复gres中Readdir方法参数为0时报错的问题; 其他一些修复:https://github.com/gogf/gf/issues?q=is%3Aissue+label%3Abug

优秀的个人博客,低调大师

DB 与 Elasticsearch 混合应用之数据离线同步

作者介绍 李猛,Elastic Stack 深度用户,通过 Elastic 工程师认证,2012年接触 Elasticsearch,对 Elastic Stack 技术栈开发、架构、运维等方面有深入体验,实践过多种大中型项目;为企业提供 Elastic Stack 咨询培训以及调优实施;多年实战经验,爱捣腾各种技术产品,擅长大数据,机器学习,系统架构。 序言 首先解释下 即时、实时与离线 概念定义,最近碰到很多的认知误区,需要纠正下。 即时概念 当数据变更之后马上就可以查询变更,内部采用事务隔离机制,查询的数据必须阻塞直到数据更新完毕,如单实例关系数据库数据发生变更后,然后马上可查询到。 实时概念 在数据同步场景中,包括异构数据源和同构数据源之间,泛指在可接受的很快时间范围内同步完成,一般的认知是秒级左右,也可以毫秒或者微秒,依据业务需求与实现

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册
修改密码
忘记密码