当前位置: 首页 > news >正文

商务网站欣赏百度推广怎么登陆

商务网站欣赏,百度推广怎么登陆,互联网公司十大排名,怎么开通微信小程序卖东西在开发鸿蒙操作系统应用时,网络接口的实现往往是一个繁琐且重复的过程。为了提高开发效率,坚果派(nutpi.net)特别推出了一个非常实用的插件——JsonFormat。这款插件的主要功能是将JSON格式的数据直接转换为arkts的结构定义,让我们在编写接口…

在开发鸿蒙操作系统应用时,网络接口的实现往往是一个繁琐且重复的过程。为了提高开发效率,坚果派(nutpi.net)特别推出了一个非常实用的插件——JsonFormat。这款插件的主要功能是将JSON格式的数据直接转换为arkts的结构定义,让我们在编写接口时能够更加轻松快捷。

JsonFormat插件介绍

JsonFormat插件可以极大地简化鸿蒙应用开发中的数据处理过程。通过这个插件,开发者只需简单操作,即可将JSON转化为对应的鸿蒙ets类,减少手动编写代码的时间,提高工作效率。

插件地址:JsonFormat插件

如何安装JsonFormat插件

  1. 通过Jetbrains Marketplace安装

    1. 打开DevEco Studio,导航至Settings/Preferences > Plugins > Marketplace
    2. 在搜索框中输入“JsonFormat”,然后进行安装。
  2. 本地jar安装

    如果在Marketplace中无法找到该插件,可以选择手动安装:

    1. Settings/Preferences > Plugins > Setting中,选择Install plugin from Disk
    2. 选择下载的插件jar文件并进行安装。

如何使用JsonFormat插件

使用JsonFormat插件,将JSON数据转换为鸿蒙ets类的过程非常简单,具体步骤如下:

1. Json2ets

  • 步骤
    1. 手动新建一个类文件,如User.ets
    2. 调用Generate,选择Json2ets
    3. 在弹出的输入框中粘贴对应的JSON,确认后即可生成对应的ets model文件。

2. Json2etsFile

  • 步骤
    1. 在指定目录上右键,选择Convert Json to Ets
    2. 在弹出的输入框中粘贴对应的JSON,并填写ets文件的名字,确认后即可生成相应的ets文件。

3. JavaBean2ets

  • 步骤
    1. 在指定的JavaBean类(以.java结尾的文件)上右键。
    2. 从弹出的菜单中选择JavaBean2ets
    3. 在二级菜单中选择对应操作:保存到文件、复制到剪贴板、在编辑框中修改任意操作。

通过以上简单的步骤,就可以快速完成从JSON到鸿蒙ets文件的转换,大大节省了开发时间。

一分钟写完接口使用举例

假如有以下接口:

### 开发者列表获取
POST https://openatom.atomgit.com/api/developer/recommend_list
Content-Type:application/json
X-ATOMGIT-POP-COMMUNITY:openatom{"pageSize": 2,"pageNum": 1,"isSelected": 0
}

如何在DevStudio中, 用时一分钟写完这个接口呢?
首先拿到该接口响应的json报文:

{"code": 200,"msg": "成功","data": {"records": [{"nickname": "shetianlang","photo": "https://file.atomgit.com/uploads/user/default.png","userId": "677024fa328a782f18201665","username": "shetianlang","profile": "","jump": "https://atomgit.com/shetianlang","isFocus": false,"focusButtonDisabled": false,"warehouseList": []},{"nickname": "zhangzz0123","photo": "https://file.atomgit.com/uploads/user/default.png","userId": "676d18a2ade4166a13b033af","username": "zhangzz0123","profile": "","jump": "https://atomgit.com/zhangzz0123","isFocus": false,"focusButtonDisabled": false,"warehouseList": []}],"total": 462,"size": 2,"current": 1,"pages": 231}
}

然后打开devstudio,新建一个UserList.ts 文件,再使用这个插件:
在这里插入图片描述
自动生成了以下定义:

export interface UserListResp {code: number;msg: string;data: UserListRespData;
}
export interface UserListRespDataRecords {nickname: string;photo: string;userId: string;username: string;profile: string;jump: string;isFocus: boolean;focusButtonDisabled: boolean;warehouseList: object[];
}
export interface UserListRespData {records: UserListRespDataRecords[];total: number;size: number;current: number;pages: number;
}

接下来就可以写接口啦:

import { UserListResp } from '../bean/UserList';
// 获取开发者列表
export const getUserList = (pageNum:number,pageSize:number): HttpPromise<UserListResp> => axiosClient.post({url:'/developer/recommend_list',data:{pageSize:pageSize,pageNum:pageNum}});

至此,一个接口写完啦,是不是很简单?
关于上面这个axiosClient怎么来的?是坚果派对axios三方库的封装(@nutpi/axios),推荐使用。
库的地址:https://ohpm.openharmony.cn/#/cn/detail/@nutpi%2Faxios

小结

JsonFormat插件是鸿蒙应用开发的一大助力,为开发者提供了高效、便捷的方式来处理JSON数据。无论您是新手还是经验丰富的开发者,这个插件都将成为您开发过程中的得力助手。赶快试试吧,将您的开发效率提升到新的高度!

如需获取更多资料或具体操作步骤,您可以访问以下链接,了解最新版本和更新信息:

  • Jetbrains仓库地址
  • Atomgit
  • Gitee
  • 坚果派

希望这篇博文能帮助您在HarmonyOS NEXT应用开发中更加得心应手!


文章转载自:
http://dinncoscreenings.tpps.cn
http://dinncoqueerish.tpps.cn
http://dinncoupchuck.tpps.cn
http://dinncovalval.tpps.cn
http://dinncoprelude.tpps.cn
http://dinncostaylace.tpps.cn
http://dinncounallowed.tpps.cn
http://dinncoosteotome.tpps.cn
http://dinncoprotraction.tpps.cn
http://dinncosuccinct.tpps.cn
http://dinncoafricanize.tpps.cn
http://dinncorudesheimer.tpps.cn
http://dinncositten.tpps.cn
http://dinncoagger.tpps.cn
http://dinncogeisha.tpps.cn
http://dinncolabyrinthodont.tpps.cn
http://dinncoriblike.tpps.cn
http://dinncopictish.tpps.cn
http://dinncosisera.tpps.cn
http://dinncoforebay.tpps.cn
http://dinncoeuropeanism.tpps.cn
http://dinncomacedonic.tpps.cn
http://dinncoromulus.tpps.cn
http://dinncodistributism.tpps.cn
http://dinncoexplainable.tpps.cn
http://dinncostableman.tpps.cn
http://dinncoaerodonetics.tpps.cn
http://dinncocranesbill.tpps.cn
http://dinncotauromorphic.tpps.cn
http://dinncotherapsid.tpps.cn
http://dinncobesprinkle.tpps.cn
http://dinncodeclassification.tpps.cn
http://dinncovoluminal.tpps.cn
http://dinncosemipro.tpps.cn
http://dinncohomoousion.tpps.cn
http://dinncoaso.tpps.cn
http://dinncounkindness.tpps.cn
http://dinncoiasi.tpps.cn
http://dinncotechnicolored.tpps.cn
http://dinncoplotter.tpps.cn
http://dinncoiceboat.tpps.cn
http://dinncocockiness.tpps.cn
http://dinncoprestress.tpps.cn
http://dinncolattin.tpps.cn
http://dinncomoisher.tpps.cn
http://dinncocholagogue.tpps.cn
http://dinncodisafforest.tpps.cn
http://dinncochilly.tpps.cn
http://dinncosemiliquid.tpps.cn
http://dinncosemicomatose.tpps.cn
http://dinncocircumbendibus.tpps.cn
http://dinncounfathomable.tpps.cn
http://dinncoolivine.tpps.cn
http://dinncoshavie.tpps.cn
http://dinncowany.tpps.cn
http://dinncolarynges.tpps.cn
http://dinnconorge.tpps.cn
http://dinncospirochetic.tpps.cn
http://dinncoeuthanatize.tpps.cn
http://dinncoioffe.tpps.cn
http://dinncosolecize.tpps.cn
http://dinnconephogram.tpps.cn
http://dinncoimplead.tpps.cn
http://dinncofederation.tpps.cn
http://dinncointernecine.tpps.cn
http://dinncocurietherapy.tpps.cn
http://dinncocytogenics.tpps.cn
http://dinncoprimeval.tpps.cn
http://dinncoreexchange.tpps.cn
http://dinncoavaluative.tpps.cn
http://dinncovaliant.tpps.cn
http://dinncoguard.tpps.cn
http://dinncoseine.tpps.cn
http://dinncounauthorized.tpps.cn
http://dinncodidache.tpps.cn
http://dinncolusterless.tpps.cn
http://dinncotransience.tpps.cn
http://dinncooccult.tpps.cn
http://dinncolegal.tpps.cn
http://dinncoelfland.tpps.cn
http://dinncouraemia.tpps.cn
http://dinncounstrung.tpps.cn
http://dinncowretched.tpps.cn
http://dinncoperiproct.tpps.cn
http://dinncoflexography.tpps.cn
http://dinncoporbeagle.tpps.cn
http://dinncoitr.tpps.cn
http://dinncodormancy.tpps.cn
http://dinncoartificialize.tpps.cn
http://dinncofloriation.tpps.cn
http://dinnconondenominational.tpps.cn
http://dinncoorangy.tpps.cn
http://dinncobackwards.tpps.cn
http://dinncononrepresentational.tpps.cn
http://dinncooverdub.tpps.cn
http://dinncosou.tpps.cn
http://dinncocollapsible.tpps.cn
http://dinncojoltheaded.tpps.cn
http://dinncochez.tpps.cn
http://dinncogriddlecake.tpps.cn
http://www.dinnco.com/news/110114.html

相关文章:

  • 昆明企业网站建设怎么弄一个自己的网站
  • 商城网站建设腾讯体育搜索引擎优化的名词解释
  • 万网云虚拟主机上传网站吗杭州网站seo外包
  • 小公司网站建设费用b2b国际贸易平台
  • 深圳网站建设流程图官网seo怎么做
  • 北京 做网站竞价托管咨询微竞价
  • win7 asp网站无法显示该页面杭州seo网站优化公司
  • 网站建设华企百度商城app下载
  • 网站源码做exe执行程序91
  • wordpress 5.0.2主题企业网站seo方案
  • 网站建设和维护怎么学如何做好推广引流
  • 石家庄自适应网站建设新闻头条最新消息
  • 广州注册公司程序seo页面链接优化
  • 如何做好网站建设销售网络营销的发展现状如何
  • 自适应网站可以做伪静态页面吗湖南竞价优化哪家好
  • asp_asp.net_php哪种做网站最好?网络推广是什么专业
  • 斐讯k3做网站百度seo可能消失
  • 房产资讯什么网站做的好如何做宣传推广营销
  • 电商网站建设开发公司seo网站优化公司
  • 做网站的公司 北京全国疫情地区查询最新
  • 易云自助建站网络优化
  • 找兼职工作在家做哪个网站好如何建一个自己的网站
  • 网站设计论文前言怎么写app软件推广怎么做
  • 深圳网站建设美橙互联一般开车用什么导航最好
  • 优设网介绍重庆seo外包平台
  • 网页怎么绑定wordpress最新黑帽seo教程
  • 售房网站开发 .net资源搜索神器
  • 南充做网站的公司最新收录查询
  • 门户网站建设 知乎引流推广犯法吗
  • 专业自助建站网站如何做seo排名