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

童装网站建设目标天气预报最新天气预报

童装网站建设目标,天气预报最新天气预报,成人用品推广网页,画网页软件:鸿蒙devceo3.1,springboot项目采用IDEA 目的: 1、结合springboot后端与鸿蒙的结合运用。 2、Log日志查看console语句的信息。 3、引入 import http from ohos.net.http。 4、调用springboot后端提供的链接发送post 5、TextInput的…

软件:鸿蒙devceo3.1,springboot项目采用IDEA

目的:

1、结合springboot后端与鸿蒙的结合运用。
2、Log日志查看console语句的信息。
3、引入
import http from '@ohos.net.http'。
4、调用springboot后端提供的链接发送post
5、TextInput的使用,onChange运算

devceo软件:

\src\main\ets\pages\FormPage.ets代码:

import http from '@ohos.net.http'
@Entry
@Component
// @Preview
struct FormPage {@State name: string = ''@State age: string = ''@State email: string = ''submitData() {const httpRequest = http.createHttp() // 创建请求实例httpRequest.request('http://localhost:8080/submitTableData',{method: http.RequestMethod.POST,header: {'Content-Type': 'application/json'},extraData: {name: this.name,age: Number(this.age),email: this.email},readTimeout: 60000}).then((res) => {console.info('请求成功,响应数据:', res.result)}).catch((err) => {console.error('请求失败:', err)})}build() {Column({ space: 10 }) {TextInput({ placeholder: '请输入姓名', text: this.name }).onChange(value => this.name = value)TextInput({ placeholder: '请输入年龄', text: this.age }).onChange(value => this.age = value)TextInput({ placeholder: '请输入邮箱', text: this.email }).onChange(value => this.email = value)Button('提交数据').onClick(() => this.submitData())}.padding(20)}
}

springboot后端:

新建项目maven的springboot:

\src\main\java\com\example\demo\controller\DataController.java

代码如下:

package com.example.demo.controller;// DataController.javaimport lombok.Data;
import org.springframework.web.bind.annotation.*;@RestController
public class DataController {@PostMapping("/submitTableData")public String submitData(@RequestBody FormData formData) {System.out.println("收到表单数据:" + formData);return "后端已收到数据:" + formData.getName();}@Datapublic static class FormData {private String name;private int age;private String email;}
}

运行结果:

http://www.ds6.com.cn/news/560.html

相关文章:

  • 网站建设 资产长尾关键词挖掘爱站网
  • 深圳网站建设定制开发 .超凡科技徐州百度推广
  • 广告公司网站建设费用seo免费系统
  • 琼筑网站是哪家做的网站排名seo
  • 企业网站建设有什么seo模拟点击软件
  • 做图片能去哪些网站企业在线培训系统
  • 禅城区企业网站建设西安seo优化工作室
  • 南京网站推广费用成都排名seo公司
  • 网站建设与设计教程实时热搜榜
  • 17网站一起做网店普杭州搜索推广公司
  • 专业网站建设哪里好百度推广官方网站
  • 商城网站策划清远网站seo
  • 网站收款即时到账怎么做的seo快排软件
  • 昆明市建设厅官方网站网站接广告
  • 北京电商网站建设外包写软文赚钱的平台都有哪些
  • 网站引导页是什么意思网站seo快速优化技巧
  • 小米路由做网站服务器企业全网推广
  • 网站建设应该学什么软件关键词歌曲免费听
  • 计算机应用技术专业网站开发方向网页优化公司
  • 做任务挣钱网站竞价推广运营
  • 盱眙在仕德伟做网站的有几家重庆自动seo
  • p2p网站建设百度快速排名点击器
  • 外贸网站seo招聘推广普通话奋进新征程
  • 官方网站想反应问题不弄应该怎么做营销案例100例小故事及感悟
  • 网站的建设方案怎么写百度seo新站优化
  • photoshop 做网站免费设计模板网站
  • 企业网站模板下载哪里seo技术培训课程
  • 长安外贸网站建设公司品牌公关
  • 广州注册公司代理记账杭州优化公司哪家好
  • 成都网站空间创新互联长沙市seo百度关键词