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

【Android学习】简单的登录页面和业务逻辑实现

实现功能

1 登录页:密码登录和验证码登录
2 忘记密码页:修改密码
3 页面基础逻辑 java代码

基础页面

在这里插入图片描述
在这里插入图片描述

XML

login_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical">
<!--    单选框--><RadioGroupandroid:id="@+id/rg_login"android:layout_width="match_parent"android:layout_height="@dimen/item_layout_height"android:orientation="horizontal"><RadioButtonandroid:id="@+id/rg_password"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"android:text="@string/login_by_password"android:textSize="@dimen/common_font_size"android:checked="true"/><RadioButtonandroid:id="@+id/rg_vertifycode"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"android:text="@string/login_by_vertifycode"android:textSize="@dimen/common_font_size"/></RadioGroup><LinearLayoutandroid:layout_width="match_parent"android:layout_height="@dimen/item_layout_height"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_phone"android:layout_width="wrap_content"android:layout_height="match_parent"android:gravity="center"android:text="@string/phone_number"android:textColor="@color/black"android:textSize="@dimen/common_font_size"/><EditTextandroid:id="@+id/et_phone"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"android:layout_marginTop="5dp"android:layout_marginBottom="5dp"android:hint="@string/inout_phone_number"android:background="@drawable/editor_selector"android:textColor="@color/black"android:maxLength="11"android:inputType="number"android:textColorHint="@color/grey"android:textSize="@dimen/common_font_size"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="@dimen/item_layout_height"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_password"android:layout_width="wrap_content"android:layout_height="match_parent"android:gravity="center"android:text="@string/login_password"android:textColor="@color/black"android:textSize="@dimen/common_font_size"/><RelativeLayoutandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"><EditTextandroid:id="@+id/et_password"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1"android:layout_marginTop="5dp"android:layout_marginBottom="5dp"android:inputType="numberPassword"android:hint="@string/input_password"android:background="@drawable/editor_selector"android:textColor="@color/black"android:maxLength="6"android:textColorHint="@color/grey"android:textSize="@dimen/common_font_size"/><Buttonandroid:id="@+id/btn_forget"android:layout_width="wrap_content"android:layout_height="match_parent"android:text="@string/forget_password"android:layout_alignParentEnd="true"android:textColorHint="@color/black"android:textSize="@dimen/common_font_size"/></RelativeLayout></LinearLayout><CheckBoxandroid:id="@+id/ck_remember"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="@string/remember_password"android:textColorHint="@color/black"android:textSize="@dimen/common_font_size"/><Buttonandroid:id="@+id/btn_login"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="@string/login"android:textColorHint="@color/black"android:textSize="@dimen/btn_font_size"/>
</LinearLayout>
login_forget_password.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="60dp"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="match_parent"android:gravity="center"android:text="@string/input_new_password"android:textColor="@color/black"android:textSize="@dimen/common_font_size"/><EditTextandroid:id="@+id/et_password_first"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1"android:layout_marginTop="5dp"android:layout_marginBottom="5dp"android:inputType="numberPassword"android:hint="@string/input_new_password_hint"android:background="@drawable/editor_selector"android:textColor="@color/black"android:maxLength="11"android:textColorHint="@color/grey"android:textSize="@dimen/common_font_size"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="60dp"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="match_parent"android:gravity="center"android:text="@string/confirm_new_password"android:textColor="@color/black"android:textSize="@dimen/common_font_size"/><EditTextandroid:id="@+id/et_password_second"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"android:layout_marginTop="5dp"android:layout_marginBottom="5dp"android:hint="@string/confirm_new_password_again"android:background="@drawable/editor_selector"android:textColor="@color/black"android:maxLength="11"android:inputType="number"android:textColorHint="@color/grey"android:textSize="@dimen/common_font_size"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="60dp"android:orientation="horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="match_parent"android:gravity="center"android:text="@string/verifycode"android:textColor="@color/black"android:textSize="@dimen/common_font_size"/><RelativeLayoutandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"><EditTextandroid:id="@+id/et_verifycode"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_weight="1"android:layout_marginTop="5dp"android:layout_marginBottom="5dp"android:inputType="numberPassword"android:hint="@string/input_verifycode"android:background="@drawable/editor_selector"android:textColor="@color/black"android:maxLength="6"android:textColorHint="@color/grey"android:textSize="@dimen/common_font_size"/><Buttonandroid:id="@+id/btn_verificode"android:layout_width="wrap_content"android:layout_height="match_parent"android:text="@string/get_verifycode"android:layout_alignParentEnd="true"android:textColorHint="@color/black"android:textSize="@dimen/common_font_size"/></RelativeLayout></LinearLayout><Buttonandroid:id="@+id/btn_confirm"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="@string/done"android:textColorHint="@color/black"android:textSize="@dimen/btn_font_size"/>
</LinearLayout>

Java

loginMain.java
package com.example.learn;import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.BlendMode;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;import com.example.learn.utils.ViewUtil;import java.util.Random;public class LoginMainActivity extends AppCompatActivity implements RadioGroup.OnCheckedChangeListener, View.OnClickListener {private EditText et_phone;private TextView tv_password;private EditText et_password;private Button btn_forget;private CheckBox ck_remember;private RadioButton rg_password;private RadioButton rg_vertifycode;private ActivityResultLauncher<Intent> register;private Button btn_login;//定义固定密码 调试使用private String mPassword = "111111";private String verifyCode;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_login_main);RadioGroup rg_login = findViewById(R.id.rg_login);et_phone = findViewById(R.id.et_phone);tv_password = findViewById(R.id.tv_password);et_password = findViewById(R.id.et_password);btn_forget = findViewById(R.id.btn_forget);ck_remember = findViewById(R.id.ck_remember);rg_password = findViewById(R.id.rg_password);rg_vertifycode = findViewById(R.id.rg_vertifycode);btn_login = findViewById(R.id.btn_login);//设置监听器rg_login.setOnCheckedChangeListener(this);//为电话号码、密码增加文本长度变换监听器et_phone.addTextChangedListener(new HideKeyboardWatch(et_phone, 11));et_password.addTextChangedListener(new HideKeyboardWatch(et_password, 6));//为忘记密码/获取验证码增加点击事件btn_forget.setOnClickListener(this);//login按钮btn_login.setOnClickListener(this);//全局registerActivityForResultregister = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),new ActivityResultCallback<ActivityResult>() {//接收返回值@Overridepublic void onActivityResult(ActivityResult result) {Intent intent = result.getData();if(intent!=null && result.getResultCode()==Activity.RESULT_OK){mPassword = intent.getStringExtra("new_password");}}});}@Overridepublic void onCheckedChanged(RadioGroup radioGroup, int checkedId) {switch (checkedId) {case R.id.rg_password://密码登录//验证码登录tv_password.setText(getString(R.string.login_password));et_password.setHint(getString(R.string.input_password));btn_forget.setText(getString(R.string.forget_password));ck_remember.setVisibility(View.VISIBLE);//显示break;case R.id.rg_vertifycode://验证码登录tv_password.setText(getString(R.string.verifycode));et_password.setHint(getString(R.string.input_verifycode));btn_forget.setText(getString(R.string.get_verifycode));ck_remember.setVisibility(View.GONE);//隐藏break;}}@Overridepublic void onClick(View view) {String phone = et_phone.getText().toString();if (phone.length() < 11) {Toast.makeText(this, "手机号码不足11位", Toast.LENGTH_SHORT).show();return;}switch (view.getId()) {case R.id.btn_forget://说明选择是密码登录// 此时按钮为忘记密码if (rg_password.isChecked()) {//此时可将手机号传递给下一个忘记密码页面Intent intent = new Intent(this, LoginForgetActivity.class);intent.putExtra("phone", phone);register.launch(intent);}else if(rg_vertifycode.isChecked()){//生成6位随机验证码verifyCode = String.format("%6d",new Random().nextInt(999999));//弹出对话框 便于用户记住验证码AlertDialog.Builder adb = new AlertDialog.Builder(this);adb.setTitle("请记住验证码");adb.setMessage("手机号"+phone+",验证码为"+verifyCode+",请输入验证码!");adb.setPositiveButton("好的",null);AlertDialog ad =adb.create();ad.show();}break;case R.id.btn_login://如果密码方式登录 判断密码是否正确if(rg_password.isChecked()){if(!mPassword.equals(et_password.getText().toString())){Toast.makeText(this,"请输入正确密码",Toast.LENGTH_SHORT).show();return;}loginSuccess();}else if(rg_vertifycode.isChecked()){if(!verifyCode.equals(et_password.getText().toString())){Toast.makeText(this,"请输入正确验证码",Toast.LENGTH_SHORT).show();return;}loginSuccess();}break;}}private void loginSuccess() {String desc=String.format("您的手机号码为%s,恭喜您登陆成功!",et_phone.getText().toString());AlertDialog.Builder adb = new AlertDialog.Builder(this);adb.setTitle("恭喜您登陆成功!");adb.setMessage("您的手机号为"+et_phone.getText().toString());adb.setNegativeButton("确定返回", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialogInterface, int i) {//结束当前活动页面finish();}});adb.setPositiveButton("我再看看",null);AlertDialog ad = adb.create();ad.show();}//编辑框监听器,当输入文本长度达到最大长度,隐藏键盘。private class HideKeyboardWatch implements TextWatcher {private EditText mView;private int maxLen;public HideKeyboardWatch(EditText et, int len) {this.mView = et;this.maxLen = len;}@Overridepublic void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}@Overridepublic void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {}@Overridepublic void afterTextChanged(Editable s) {if (s.toString().length() == maxLen) {//隐藏软键盘ViewUtil.hideKeyboard(LoginMainActivity.this, mView);}}}
}
login_forget_password.java
package com.example.learn;import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;import java.util.Random;public class LoginForgetActivity extends AppCompatActivity implements View.OnClickListener {private String mPhone;private String verifyCode;private EditText et_password_first;private EditText et_password_second;private EditText et_verifycode;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_login_forget);mPhone = getIntent().getStringExtra("phone");findViewById(R.id.btn_verificode).setOnClickListener(this);findViewById(R.id.btn_confirm).setOnClickListener(this); et_password_first = findViewById(R.id.et_password_first);et_password_second = findViewById(R.id.et_password_second);et_verifycode = findViewById(R.id.et_verifycode);}@Overridepublic void onClick(View view) {switch(view.getId()){case R.id.btn_verificode://生成6位随机验证码verifyCode = String.format("%6d",new Random().nextInt(999999));//弹出对话框 便于用户记住验证码AlertDialog.Builder adb = new AlertDialog.Builder(this);adb.setTitle("请记住验证码");adb.setMessage("手机号"+mPhone+",验证码为"+verifyCode+",请输入验证码!");adb.setPositiveButton("好的",null);AlertDialog ad =adb.create();ad.show();break;case R.id.btn_confirm:String pf = et_password_first.getText().toString();String ps = et_password_second.getText().toString();if(pf.length()<6){Toast.makeText(this,"请输入正确密码",Toast.LENGTH_SHORT).show();return;}if(!pf.equals(ps)){Toast.makeText(this,"两次密码不同",Toast.LENGTH_SHORT).show();return;}if(!verifyCode.equals(et_verifycode.getText().toString())){Toast.makeText(this,"验证码不正确",Toast.LENGTH_SHORT).show();return;}Toast.makeText(this,"密码修改成功",Toast.LENGTH_SHORT).show();Intent intent = new Intent();intent.putExtra("new_password",pf);setResult(Activity.RESULT_OK,intent);finish();//结束当前页面break;}}
}

相关文章:

【Android学习】简单的登录页面和业务逻辑实现

实现功能 1 登录页&#xff1a;密码登录和验证码登录 2 忘记密码页&#xff1a;修改密码 3 页面基础逻辑 java代码 基础页面 XML login_main.xml <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas.and…...

Mysql数据库的基础学习

为什么使用数据库&#xff1f; 1.持久化&#xff1a;将数据保存到可掉电式存储设备中以供使用。 数据库相关概念&#xff1a; DB:数据库&#xff08;Databass&#xff09;即存储数据的仓库&#xff0c;本质是一个文件系统&#xff0c;保存了一系列有组织的数据DBMS:数据库管…...

CentOS7 安装 Kamailio

https://www.kamailio.org/wiki/packages/rpms 官方文档说 yum -y install yum-utils yum-config-manager --add-repo https://rpm.kamailio.org/centos/kamailio.repo 但目前这样其实行不通 需要这样做&#xff1a; yum install --disablerepokamailio --enablerepokamai…...

Tomcat启动闪退问题解决办法

本文将通过一系列诊断步骤帮助您找出原因&#xff0c;并提供相应的解决办法。 诊断步骤 查看日志文件 Tomcat的日志文件是解决启动问题的第一线工具。查看logs目录下的catalina.out和其他日志文件&#xff0c;这些文件经常记录了错误信息和系统崩溃的线索。 cat /path/to/to…...

单元测试之JUnit5知识点总结及代码示例

单元测试是软件开发过程中的一种验证手段&#xff0c;它针对最小的可测试部分&#xff08;通常是函数或方法&#xff09;进行检查和验证。其实单元测试还是挺重要的&#xff0c;不过国内很多公司的项目其实并没有做好单元测试&#xff0c;或者根本就没做单元测试&#xff0c;原…...

什么是数据平台——企业构建Data+AI的基础数据底座需要的决策参考

什么是数据平台 标准的解释是这样的 Wikipedia A data platform usually refers to a software platform used for collecting and managing data, and acting as a data delivery point for application and reporting software. 数据平台是指将各类数据进行整合、存储、处…...

Oracle 流stream数据的复制

Oracle 流stream数据的复制 --实验的目的是捕获scott.emp1表的变化&#xff0c;将变化应用到远程数据库scott.emp1表中。 --设置初始化参数 AQ_TM_PROCESSES1 COMPATIBLE9.2.0 LOG_PARALLELISM1 GLOBAL_NAMEStrue JOB_QUEUE_PROCESSES2 --查看数据库的名称&#xff0c;我的为o…...

「 安全设计 」68家国内外科技巨头和安全巨头参与了CISA发起的安全设计承诺,包含MFA、默认密码、CVE、VDP等七大承诺目标

美国网络安全和基础设施安全局&#xff08;CISA&#xff0c;CyberSecurity & Infrastructure Security Agency&#xff09;于2024年5月开始呼吁企业是时候将网络安全融入到技术产品的设计和制造中了&#xff0c;并发起了安全设计承诺行动&#xff0c;该承诺旨在补充和建立现…...

【K8S】pod无限重启,报错Back-off restarting failed container

1. 问题 pod启动后一直重启&#xff0c;并报Back-off restarting failed container。 原理&#xff1a; Back-off restarting failed container的Warning事件&#xff0c;一般是由于通过指定的镜像启动容器后&#xff0c;容器内部没有常驻进程&#xff0c;导致容器启动成功后…...

摸鱼文章1

1111111...

【设计模式】之适配器模式

系列文章目录 &#xff08;其他设计模式可以到 &#x1f449;&#x1f449;&#x1f449;&#xff09;设计模式_小杰不秃头的博客 &#x1f60a;&#x1f604;&#x1f61b; 前言 今天继续给大家介绍23种设计模式中的适配器模式&#xff0c;这个模式相比于其他模式比较好理解…...

Python轻量级Web框架Flask(13)—— Flask个人博客项目

0、前言: ★这部分内容是基于之前Flask学习内容的一个实战项目梳理内容,没有可以直接抄下来跑的代码,是学习了之前Flask基础知识之后,再来看这部分内容,就会对Flask项目开发流程有更清楚的认知,对一些开发细节可以进一步的学习。项目功能,通过Flask制作个人博客。项目架…...

电商技术揭秘营销相关系列文章合集(4)

相关系列文章 电商技术揭秘相关系列文章合集&#xff08;1&#xff09; 电商技术揭秘相关系列文章合集&#xff08;2&#xff09; 电商技术揭秘相关系列文章合集&#xff08;3&#xff09; 文章目录 引言集合说明集合文章列表 引言 在数字化浪潮的推动下&#xff0c;电商行…...

LeetCode-2391. 收集垃圾的最少总时间【数组 字符串 前缀和】

LeetCode-2391. 收集垃圾的最少总时间【数组 字符串 前缀和】 题目描述&#xff1a;解题思路一&#xff1a;处理垃圾和路程单独计算。解题思路二&#xff1a;逆向思维&#xff0c;计算多走的路解题思路三&#xff1a;只记录&#xff0c;当前t需要计算几次 题目描述&#xff1a;…...

再有人说数字孪生大屏没有用,用这8条怼回去。

数字孪生大屏之所以受到欢迎&#xff0c;主要有以下几个原因&#xff1a; 实时数据可视化 数字孪生大屏可以将实时数据以直观的可视化形式展示出来&#xff0c;让用户能够一目了然地了解数据的状态和趋势。这样可以帮助用户更好地理解和分析数据&#xff0c;及时做出决策和调…...

蓝桥杯练习系统(算法训练)ALGO-946 Q神的足球赛

资源限制 内存限制&#xff1a;256.0MB C/C时间限制&#xff1a;1.0s Java时间限制&#xff1a;3.0s Python时间限制&#xff1a;5.0s 问题描述 足球赛上&#xff0c;只见Q神如闪电般的速度带球时而左&#xff0c;时而右&#xff0c;时而前&#xff0c;时而后&#xff…...

【Android】Kotlin学习之Kotlin方法的声明和传参

方法声明 普通类的方法 静态类的方法 不需要构建实例对象, 可以通过类名直接访问静态方法 : NumUtil.double(1) companion object 伴生类的方法 使用companion object 在普通类里定义静态方法 参数 括号内传入方法 : 当参数是方法时, 并且是最后一个参数 , 可以使用括号外…...

微信小程序 17:小程序使用 npm 包和组件应用

目前&#xff0c;小程序中已经支持实用 npm 安装第三方包&#xff0c;从而提高小程序的开发效率&#xff0c;但是在小程序中使用 npm 包有三个限制&#xff1a; 不支持 Node.js内置库的包不支持依赖于浏览器内置对象的包不支持依赖于 C插件的包 Vant Weapp Vant Weapp是有赞…...

【mysql篇】执行delete删除大量数据后,磁盘未清空,为什么?

目录 迁移脚本删除数据以及备份数据 解决方法OPTIMIZE TABLE二进制日志按月生成数据 最近某个项目虽说用户量不大&#xff0c;但是&#xff0c;单表的数据量越来越大&#xff0c;mysql一般单表超过千万级别后&#xff0c;性能直线下降&#xff0c;所以利用shardingphere按月做了…...

【Qt 学习笔记】Qt常用控件 | 多元素控件 | Tree Widget的说明及介绍

博客主页&#xff1a;Duck Bro 博客主页系列专栏&#xff1a;Qt 专栏关注博主&#xff0c;后期持续更新系列文章如果有错误感谢请大家批评指出&#xff0c;及时修改感谢大家点赞&#x1f44d;收藏⭐评论✍ Qt常用控件 | 多元素控件 | Tree Widget的说明及介绍 文章编号&#x…...

在Mars3d实现cesium的ImageryLayer自定义瓦片的层级与原点

需要自定义瓦片层级和原点&#xff0c;所以需要自己写第三方图层&#xff0c;但是之前写的很多方法&#xff0c;图层控制和显隐以及透明度&#xff0c;需要跟之前的交互一直&#xff0c;改动量太大的话不划算&#xff0c;所以直接看Mars3d的layer基类&#xff0c;把重写的image…...

logback日志持久化

1、问题描述 使用logback持久化记录日志。 2、我的代码 logback是Springboot框架里自带的&#xff0c;所以只要引入“spring-boot-starter”就行了。无需额外引入logback依赖。 pom.xml <?xml version"1.0" encoding"UTF-8"?> <project xmlns&…...

函数原型(Function Prototype)、函数定义(Function Definition)和函数声明(Function Declaration)

函数原型&#xff08;Function Prototype&#xff09;、函数定义&#xff08;Function Definition&#xff09;和函数声明&#xff08;Function Declaration&#xff09;在C和C等编程语言中扮演着不同的角色&#xff0c;但它们有时在概念上可能会有些重叠。下面是它们之间的主要…...

Go有无缓冲channel的区别

无缓冲的channel channel的默认类型就是无缓冲的。当一个数据被发送到无缓冲的channel中&#xff0c;发送操作会被阻塞&#xff0c;知道有另一个goroutine从这个channel中接收这个数据。同样&#xff0c;当试图从一个无缓冲的channel中接收数据时&#xff0c;如果没有数据可以…...

【全开源】Fastflow工作流系统(源码搭建/上线/运营/售后/维护更新)

一款基于FastAdminThinkPHP开发的可视化工作流程审批插件&#xff0c;帮助用户基于企业业务模式和管理模式自行定义所需的各种流程应用&#xff0c;快速构建企业自身的流程管控体系&#xff0c;快速融合至企业协同OA办公系统。 提供全部无加密服务端源码和前端源代码&#xff0…...

超越传统游戏:生成式人工智能对游戏的变革性影响

人工智能&#xff08;AI&#xff09;在游戏中的应用 游戏产业是一个充满活力、不断发展的领域&#xff0c;人工智能&#xff08;AI&#xff09;的融入对其产生了重大影响。这一技术进步彻底改变了游戏的开发、玩法和体验方式。本文分析的重点是传统人工智能和生成式人工智能在游…...

SpringCloud微服务之Eureka、Ribbon、Nacos详解

SpringCloud微服务之Eureka、Ribbon、Nacos详解 1、认识微服务1.1、单体架构1.2、分布式架构1.3、微服务1.4、SpringCloud 2、服务拆分与远程调用2.1、服务拆分的原则2.2、服务拆分示例2.2、提供者与消费者 3、Eureka注册中心3.1、Eureka的结构和作用3.2、搭建eureka-server3.2…...

五角钱的程序员 | Kafka 是什么?

本文来源公众号“五角钱的程序员”&#xff0c;仅用于学术分享&#xff0c;侵权删&#xff0c;干货满满。 原文链接&#xff1a;Kafka 是什么&#xff1f; 你是一个程序员&#xff0c;假设你维护了两个服务 A 和 B。B 服务每秒只能处理 100 个消息&#xff0c;但 A 服务却每秒…...

C++中合成的默认构造函数的访问权限

问题 我们知道&#xff0c;在C中&#xff0c;如果没有为一个类显式定义构造函数&#xff0c;那么编译器会为我们隐式地定义一个默认构造函数。那么&#xff0c;你有没有想过&#xff0c;这个隐式定义的默认构造函数&#xff08;合成的默认构造函数&#xff09;的访问权限是什么…...

【前端】桌面版docker并部署前端项目

环境 win10专业版 2004 , 需科学 官网下载安装包并安装4.29.0版本 终端输入 wsl --installdocker桌面版和模拟器只能选一个&#xff0c;不然一直转圈圈 镜像配置加速&#xff0c;在settings—>docker engine下 {"builder": {"gc": {"defaultKee…...