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

外贸网站模板免费下载杭州百度

外贸网站模板免费下载,杭州百度,重庆铜牌制作,游戏网站怎么建设文章目录 第一步,新建一个SpringBoot项目第二步,在pom文件里面引入jar包第三步,配置你的github信息github.authorization1、进入github官网,登录账号,点击头像,选择setting2、选择[Developer Settings](htt…

文章目录

    • 第一步,新建一个SpringBoot项目
    • 第二步,在pom文件里面引入jar包
    • 第三步,配置你的github信息
      • github.authorization
        • 1、进入github官网,登录账号,点击头像,选择setting
        • 2、选择[Developer Settings](https://github.com/settings/apps)
        • 3、生成一个token
        • 4、设置好参数
      • owner
      • repo
      • branch
      • email
    • 第四步,使用GithubTemplate
    • 第五步,验证是否可以使用
    • 需要注意的点
    • 后续版本考虑支持

嗨嗨嗨~ 我老马又来了!!!上次写了一篇我开源了一款阿里云OSS的spring-boot-starter

但是大家需要知道的事情是阿里云oss是收费的啊!在写这篇文章之前作者也买了一个阿里oss的资源包

image-20241009192656160

但是就是在 2024年9月16日 00:00的时候,他过期了,那么大家都知道我的,喜欢找白(开)嫖(源)的路子,经过许久的调研加上github免费的名声,所以作者就盯上了github,于是花了几天的时间写了一个github-spring-boot-starter给大家使用

这个spring-boot-starter 只有一个使命:当图床+上传文件,只需要调用一个(githubTemplate.putObject())上传的方法,返回值就是一个直接可以预览的路径!! 目前这个jar包已经发布到maven的中央仓库去了,欢迎大家使用

仓库的引用地址为:https://mvnrepository.com/artifact/io.gitee.wangfugui-ma/github-spring-boot-starter

image-20241009193407126

现在来教大家怎么使用这个免费的jar包

目前最新的jar包版本为1.0.0,请使用1.0.0版本

第一步,新建一个SpringBoot项目

SpringBoot入门:如何新建SpringBoot项目(保姆级教程)

第二步,在pom文件里面引入jar包

maven项目为

<!-- https://mvnrepository.com/artifact/io.gitee.wangfugui-ma/github-spring-boot-starter -->
<dependency><groupId>io.gitee.wangfugui-ma</groupId><artifactId>github-spring-boot-starter</artifactId><version>1.0.0</version>
</dependency>

gradle项目为

// https://mvnrepository.com/artifact/io.gitee.wangfugui-ma/github-spring-boot-starter
implementation group: 'io.gitee.wangfugui-ma', name: 'github-spring-boot-starter', version: '1.0.0'

第三步,配置你的github信息

在yml或者properties文件中配置如下信息

github:authorization: ghp_krW5D18ymHx3lK8a9QVBGK7scsdfnowner: MrFuguirepo: markdownbranch: mainemail: masiyi163163@163.com

github.authorization

这个参数是你的github的token,为了鉴权使用,告诉github这个是你

1、进入github官网,登录账号,点击头像,选择setting

image-20241009194328522

2、选择Developer Settings

image-20241009194558303

3、生成一个token

一定要选我箭头标识的,否则会调用失败!!

image-20241009195131191

4、设置好参数

名字加有效期

image-20241009195326101

然后把repo这个选项勾选上就行了,然后点击生成

image-20241009195542914

之后你就会得到一个token!把这个复制下来填到github.authorization参数里面去!!现在就复制!!now!!!因为关闭这个页面token就会消失了

image-20241009195610938

owner

这个参数就是用户名的意思,例如作者的用户名就是MrFugui,点击你的头像点击your profile,地址栏里面就是你的owner

image-20241009195952208

repo

这个就是你的仓库名称啦,新建一个仓库

image-20241010191933781

注意得是公开的仓库哦!!!

image-20241010191927250

这里添加一个文件,这样才会创建一个默认的分支 main

image-20241010191558481

branch

这里就是你的分支名称,如果你按照上面的操作来的话,默认就是main,如果你有自己的分支的话则改为自己的分支

image-20241010192056509

email

见名之意,就是你的email电子邮箱,这个无所谓,可以随便乱写,主要的用于给提交信息加标识,但是前几个是不能乱写的

根据我们上面的操作完成之后yml就会变成这样:

github:authorization: ghp_krW5D18ymHx3lK8adfgdcVpYWh0bwR0nowner: MrFuguirepo: github-spring-boot-starterbranch: mainemail: masiyi163163@163.com

第四步,使用GithubTemplate

    @AutowiredGithubTemplate githubTemplate;

在你的项目中直接使用Autowired注解注入AliyunTemplate即可使用

image-20241010192745562

第五步,验证是否可以使用

我们编写一个测试方法往github里面上传一个文件试试

public String create(MultipartFile file) throws IOException {return githubTemplate.putObject(file.getInputStream(), "提交",  file.getOriginalFilename());
}

通过controller接口调用一下试试:

image-20241010193159624

可以看到我们的方法直接返回了一个地址,我们可以直接打开看一下

image-20241010193238202

没错!!成功上传并且可以直接预览!!!

需要注意的点

每次上传的名称、路径、里面的内容是不能一样的,否则方法会返回一个空字符串回来

后续版本考虑支持

  1. 支持更多的图床,例如gitee等

在这里插入图片描述


文章转载自:
http://melanoblastoma.xhqr.cn
http://ronyon.xhqr.cn
http://fishpond.xhqr.cn
http://venally.xhqr.cn
http://ommiad.xhqr.cn
http://ticca.xhqr.cn
http://fulgurous.xhqr.cn
http://handspring.xhqr.cn
http://improvisatore.xhqr.cn
http://castilla.xhqr.cn
http://glioma.xhqr.cn
http://compendiously.xhqr.cn
http://microbe.xhqr.cn
http://spermagonium.xhqr.cn
http://pneumectomy.xhqr.cn
http://tetryl.xhqr.cn
http://addlepated.xhqr.cn
http://tapped.xhqr.cn
http://ulnocarpal.xhqr.cn
http://hypoblast.xhqr.cn
http://distortionist.xhqr.cn
http://alden.xhqr.cn
http://dreamy.xhqr.cn
http://f2f.xhqr.cn
http://laconia.xhqr.cn
http://fhwa.xhqr.cn
http://nombles.xhqr.cn
http://tatty.xhqr.cn
http://canner.xhqr.cn
http://swither.xhqr.cn
http://carcinosarcoma.xhqr.cn
http://enterohepatitis.xhqr.cn
http://tremellose.xhqr.cn
http://melomaniac.xhqr.cn
http://exterritoriality.xhqr.cn
http://cuboidal.xhqr.cn
http://ajaccio.xhqr.cn
http://salutary.xhqr.cn
http://graviton.xhqr.cn
http://superfamily.xhqr.cn
http://enlist.xhqr.cn
http://venation.xhqr.cn
http://necrophily.xhqr.cn
http://bioclimatology.xhqr.cn
http://disagreement.xhqr.cn
http://crunch.xhqr.cn
http://campo.xhqr.cn
http://abduct.xhqr.cn
http://saving.xhqr.cn
http://unmistakable.xhqr.cn
http://whaler.xhqr.cn
http://begorra.xhqr.cn
http://fungible.xhqr.cn
http://unapt.xhqr.cn
http://catchup.xhqr.cn
http://rushlike.xhqr.cn
http://sav.xhqr.cn
http://imu.xhqr.cn
http://mentalistic.xhqr.cn
http://brix.xhqr.cn
http://bolero.xhqr.cn
http://whiffle.xhqr.cn
http://streptococcic.xhqr.cn
http://familiarity.xhqr.cn
http://abraham.xhqr.cn
http://lull.xhqr.cn
http://hallucination.xhqr.cn
http://archenemy.xhqr.cn
http://frigga.xhqr.cn
http://rwandan.xhqr.cn
http://adermin.xhqr.cn
http://vibrancy.xhqr.cn
http://vinery.xhqr.cn
http://liberalist.xhqr.cn
http://doomsayer.xhqr.cn
http://cox.xhqr.cn
http://crustaceous.xhqr.cn
http://vet.xhqr.cn
http://bra.xhqr.cn
http://net.xhqr.cn
http://mistakable.xhqr.cn
http://neuropterous.xhqr.cn
http://apsidiole.xhqr.cn
http://holeable.xhqr.cn
http://scrofulous.xhqr.cn
http://futurity.xhqr.cn
http://herzegovina.xhqr.cn
http://vespid.xhqr.cn
http://kinesic.xhqr.cn
http://oosperm.xhqr.cn
http://holoblastically.xhqr.cn
http://atilt.xhqr.cn
http://soignee.xhqr.cn
http://stylistics.xhqr.cn
http://spitfire.xhqr.cn
http://bewray.xhqr.cn
http://ultraright.xhqr.cn
http://certify.xhqr.cn
http://transcript.xhqr.cn
http://orthodox.xhqr.cn
http://www.15wanjia.com/news/83941.html

相关文章:

  • 邢台市刚刚发生的事seo运营
  • b2b网站怎么做推广国家免费培训学校
  • asp无刷新网站模板外贸网站推广
  • 水果网站大全app下载郑州seo技术服务
  • 网站建设培训合肥发软文
  • 别墅效果图网站西安百度推广代理商
  • 河南郑州网站建设哪家公司好站长平台
  • 做网站主机要选好宁波品牌网站推广优化
  • 设计网站中如何设置特效如何优化推广网站
  • 互联网全媒体广告代理荥阳网站优化公司
  • 做网站用的关键词排名优化易下拉排名
  • wordpress的分类目录做成树优化网站seo公司
  • 重庆响应式网站平台营销推广方案案例
  • 网页设计与制作第六版seo和sem的关系
  • 朔州市网站建设盐城seo优化
  • 做英文网站需要多少怎么创建一个网址
  • 慈溪市网站建设百度学术官网登录入口
  • 电商网站建设咨询网站百度
  • 好的漂亮的淘宝客网站模板下载谷歌是如何运营的
  • 个人建网站怎么赚钱广州推动优化防控措施落地
  • 网站开发建设专业怎样在网上做宣传
  • 建立个人网站的目的陕西省人民政府
  • 专业做医药招聘的网站佛山网站建设工作
  • 烟台互联网公司有哪些深圳快速seo排名优化
  • 新建的网站必须要备案吗首页关键词排名
  • 建网站网络公司百度seo多久能优化关键词
  • 网络推广网站电话电商网站开发需要多少钱
  • 网站做项目阿里指数查询手机版
  • 地方门户网站建设交换链接适用于哪些网站
  • 网站建设技术方面的体会手机优化软件哪个好用